OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 // Next Protocol Negotiation (NPN), if successful, results in agreement on an | 77 // Next Protocol Negotiation (NPN), if successful, results in agreement on an |
78 // application-level string that specifies the application level protocol to | 78 // application-level string that specifies the application level protocol to |
79 // use over the TLS connection. NextProto enumerates the application level | 79 // use over the TLS connection. NextProto enumerates the application level |
80 // protocols that we recognise. | 80 // protocols that we recognise. |
81 enum NextProto { | 81 enum NextProto { |
82 kProtoUnknown = 0, | 82 kProtoUnknown = 0, |
83 kProtoHTTP11 = 1, | 83 kProtoHTTP11 = 1, |
84 kProtoSPDY1 = 2, | 84 kProtoSPDY1 = 2, |
85 kProtoSPDY2 = 3, | 85 kProtoSPDY2 = 3, |
| 86 kProtoSPDY21 = 4, |
86 }; | 87 }; |
87 | 88 |
88 // Gets the SSL connection information of the socket. | 89 // Gets the SSL connection information of the socket. |
89 // | 90 // |
90 // TODO(sergeyu): Move this method to the SSLSocket interface and | 91 // TODO(sergeyu): Move this method to the SSLSocket interface and |
91 // implemented in SSLServerSocket too. | 92 // implemented in SSLServerSocket too. |
92 virtual void GetSSLInfo(SSLInfo* ssl_info) = 0; | 93 virtual void GetSSLInfo(SSLInfo* ssl_info) = 0; |
93 | 94 |
94 // Gets the SSL CertificateRequest info of the socket after Connect failed | 95 // Gets the SSL CertificateRequest info of the socket after Connect failed |
95 // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. | 96 // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. |
(...skipping 23 matching lines...) Expand all Loading... |
119 static bool IgnoreCertError(int error, int load_flags); | 120 static bool IgnoreCertError(int error, int load_flags); |
120 | 121 |
121 virtual bool was_npn_negotiated() const; | 122 virtual bool was_npn_negotiated() const; |
122 | 123 |
123 virtual bool set_was_npn_negotiated(bool negotiated); | 124 virtual bool set_was_npn_negotiated(bool negotiated); |
124 | 125 |
125 virtual bool was_spdy_negotiated() const; | 126 virtual bool was_spdy_negotiated() const; |
126 | 127 |
127 virtual bool set_was_spdy_negotiated(bool negotiated); | 128 virtual bool set_was_spdy_negotiated(bool negotiated); |
128 | 129 |
| 130 virtual SSLClientSocket::NextProto next_protocol_negotiated() const; |
| 131 |
| 132 virtual void set_next_protocol_negotiated( |
| 133 SSLClientSocket::NextProto next_protocol); |
| 134 |
129 // Returns true if an origin bound certificate was sent on this connection. | 135 // Returns true if an origin bound certificate was sent on this connection. |
130 // This may be useful for protocols, like SPDY, which allow the same | 136 // This may be useful for protocols, like SPDY, which allow the same |
131 // connection to be shared between multiple origins, each of which need | 137 // connection to be shared between multiple origins, each of which need |
132 // an origin bound certificate. | 138 // an origin bound certificate. |
133 virtual bool was_origin_bound_cert_sent() const; | 139 virtual bool was_origin_bound_cert_sent() const; |
134 | 140 |
135 virtual bool set_was_origin_bound_cert_sent(bool sent); | 141 virtual bool set_was_origin_bound_cert_sent(bool sent); |
136 | 142 |
137 private: | 143 private: |
138 // True if NPN was responded to, independent of selecting SPDY or HTTP. | 144 // True if NPN was responded to, independent of selecting SPDY or HTTP. |
139 bool was_npn_negotiated_; | 145 bool was_npn_negotiated_; |
140 // True if NPN successfully negotiated SPDY. | 146 // True if NPN successfully negotiated SPDY. |
141 bool was_spdy_negotiated_; | 147 bool was_spdy_negotiated_; |
| 148 // Protocol that we negotiated with the server. |
| 149 SSLClientSocket::NextProto next_protocol_; |
142 // True if an origin bound certificate was sent. | 150 // True if an origin bound certificate was sent. |
143 bool was_origin_bound_cert_sent_; | 151 bool was_origin_bound_cert_sent_; |
144 }; | 152 }; |
145 | 153 |
146 } // namespace net | 154 } // namespace net |
147 | 155 |
148 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 156 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
OLD | NEW |