Index: blimp/net/ssl_client_transport.h |
diff --git a/blimp/net/ssl_client_transport.h b/blimp/net/ssl_client_transport.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0f0a1f4a7a5f62219742eb918990b24ab23ee60a |
--- /dev/null |
+++ b/blimp/net/ssl_client_transport.h |
@@ -0,0 +1,64 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ |
+#define BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ |
+ |
+#include <string> |
+#include "base/callback_forward.h" |
+#include "base/macros.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "blimp/net/blimp_net_export.h" |
+#include "blimp/net/blimp_transport.h" |
+#include "blimp/net/exact_match_cert_verifier.h" |
+#include "blimp/net/tcp_client_transport.h" |
+#include "net/base/address_list.h" |
+#include "net/base/net_errors.h" |
+#include "net/http/transport_security_state.h" |
+ |
+namespace net { |
+class ClientSocketFactory; |
+class NetLog; |
+class StreamSocket; |
+class TCPClientSocket; |
+class TransportSecurityState; |
+} // namespace net |
+ |
+namespace blimp { |
+ |
+class BlimpConnection; |
+ |
+// Creates and connects SSL socket connections to an Engine. |
+class BLIMP_NET_EXPORT SSLClientTransport : public TCPClientTransport { |
+ public: |
+ // |ip_endpoint|: the address to connect to. |
+ // |cert|: the certificate required from the remote peer. |
+ // SSL connections that use different certificates are rejected. |
+ // |net_log|: the socket event log (optional). |
+ SSLClientTransport(const net::IPEndPoint& ip_endpoint, |
+ scoped_refptr<net::X509Certificate> cert, |
+ net::NetLog* net_log); |
+ |
+ ~SSLClientTransport() override; |
+ |
+ // BlimpTransport implementation. |
+ const char* GetName() const override; |
+ |
+ private: |
+ // Method called after TCPClientSocket::Connect finishes. |
+ void OnTCPConnectComplete(int result) override; |
+ |
+ // Method called after SSLClientSocket::Connect finishes. |
+ void OnSSLConnectComplete(int result); |
+ |
+ net::IPEndPoint ip_endpoint_; |
+ scoped_ptr<ExactMatchCertVerifier> cert_verifier_; |
+ net::TransportSecurityState transport_security_state_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SSLClientTransport); |
+}; |
+ |
+} // namespace blimp |
+ |
+#endif // BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ |