OLD | NEW |
| (Empty) |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ | |
6 #define BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ | |
7 | |
8 #include <memory> | |
9 #include <string> | |
10 | |
11 #include "base/callback_forward.h" | |
12 #include "base/macros.h" | |
13 #include "blimp/net/blimp_net_export.h" | |
14 #include "blimp/net/blimp_transport.h" | |
15 #include "blimp/net/exact_match_cert_verifier.h" | |
16 #include "blimp/net/tcp_client_transport.h" | |
17 #include "net/base/address_list.h" | |
18 #include "net/base/net_errors.h" | |
19 #include "net/cert/ct_policy_enforcer.h" | |
20 #include "net/cert/multi_log_ct_verifier.h" | |
21 #include "net/http/transport_security_state.h" | |
22 | |
23 namespace net { | |
24 class NetLog; | |
25 class TCPClientSocket; | |
26 class TransportSecurityState; | |
27 } // namespace net | |
28 | |
29 namespace blimp { | |
30 | |
31 // Creates and connects SSL socket connections to an Engine. | |
32 class BLIMP_NET_EXPORT SSLClientTransport : public TCPClientTransport { | |
33 public: | |
34 // |ip_endpoint|: the address to connect to. | |
35 // |cert|: the certificate required from the remote peer. | |
36 // SSL connections that use different certificates are rejected. | |
37 // |net_log|: the socket event log (optional). | |
38 SSLClientTransport(const net::IPEndPoint& ip_endpoint, | |
39 scoped_refptr<net::X509Certificate> cert, | |
40 net::NetLog* net_log); | |
41 | |
42 ~SSLClientTransport() override; | |
43 | |
44 // BlimpTransport implementation. | |
45 const char* GetName() const override; | |
46 | |
47 private: | |
48 // Method called after TCPClientSocket::Connect finishes. | |
49 void OnTCPConnectComplete(int result) override; | |
50 | |
51 // Method called after SSLClientSocket::Connect finishes. | |
52 void OnSSLConnectComplete(int result); | |
53 | |
54 net::IPEndPoint ip_endpoint_; | |
55 std::unique_ptr<ExactMatchCertVerifier> cert_verifier_; | |
56 net::TransportSecurityState transport_security_state_; | |
57 net::MultiLogCTVerifier cert_transparency_verifier_; | |
58 net::CTPolicyEnforcer ct_policy_enforcer_; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(SSLClientTransport); | |
61 }; | |
62 | |
63 } // namespace blimp | |
64 | |
65 #endif // BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ | |
OLD | NEW |