Unreviewed, rolling out r245418.
[WebKit-https.git] / Tools / TestWebKitAPI / TCPServer.h
index 6668c73..fbe81a2 100644 (file)
 #include <wtf/Function.h>
 #include <wtf/Vector.h>
 
+extern "C" {
 struct SSL;
+int SSL_read(SSL*, void*, int);
+int SSL_write(SSL*, const void*, int);
+}
 
 namespace TestWebKitAPI {
 
@@ -40,25 +44,14 @@ public:
     static constexpr Port InvalidPort = 0;
     
     TCPServer(Function<void(Socket)>&&, size_t connections = 1);
-    enum class Protocol : uint8_t {
-        HTTPS,
-        HTTPSProxy,
-        HTTPSWithClientCertificateRequest,
+    enum class Protocol : bool {
+        HTTPS, HTTPSProxy
     };
     TCPServer(Protocol, Function<void(SSL*)>&&);
     ~TCPServer();
     
     Port port() const { return m_port; }
     
-    static void respondWithOK(SSL*);
-    static void respondWithChallengeThenOK(Socket);
-
-    template<typename T> static Vector<uint8_t> read(T);
-    template<typename T> static void write(T, const void*, size_t);
-
-    static Vector<uint8_t> testPrivateKey();
-    static Vector<uint8_t> testCertificate();
-    
 private:
     Optional<Socket> socketBindListen(size_t connections);
     void listenForConnections(size_t connections);