Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2797)

Unified Diff: blimp/net/ssl_client_transport.h

Issue 1696563002: Blimp: add support for SSL connections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reland (safe_json issue fixed). Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/net/exact_match_cert_verifier.cc ('k') | blimp/net/ssl_client_transport.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « blimp/net/exact_match_cert_verifier.cc ('k') | blimp/net/ssl_client_transport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698