| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_NSS_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <certt.h> | 9 #include <certt.h> |
| 10 #include <keyt.h> | 10 #include <keyt.h> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // An SSL client socket implemented with Mozilla NSS. | 37 // An SSL client socket implemented with Mozilla NSS. |
| 38 class SSLClientSocketNSS : public SSLClientSocket { | 38 class SSLClientSocketNSS : public SSLClientSocket { |
| 39 public: | 39 public: |
| 40 // Takes ownership of the |transport_socket|, which must already be connected. | 40 // Takes ownership of the |transport_socket|, which must already be connected. |
| 41 // The given hostname will be compared with the name(s) in the server's | 41 // The given hostname will be compared with the name(s) in the server's |
| 42 // certificate during the SSL handshake. ssl_config specifies the SSL | 42 // certificate during the SSL handshake. ssl_config specifies the SSL |
| 43 // settings. | 43 // settings. |
| 44 SSLClientSocketNSS(ClientSocketHandle* transport_socket, | 44 SSLClientSocketNSS(ClientSocketHandle* transport_socket, |
| 45 const std::string& hostname, | 45 const std::string& hostname, |
| 46 uint16 port, |
| 46 const SSLConfig& ssl_config, | 47 const SSLConfig& ssl_config, |
| 47 SSLHostInfo* ssl_host_info, | 48 SSLHostInfo* ssl_host_info, |
| 48 DnsRRResolver* dnsrr_resolver); | 49 DnsRRResolver* dnsrr_resolver); |
| 49 ~SSLClientSocketNSS(); | 50 ~SSLClientSocketNSS(); |
| 50 | 51 |
| 51 // SSLClientSocket methods: | 52 // SSLClientSocket methods: |
| 52 virtual void GetSSLInfo(SSLInfo* ssl_info); | 53 virtual void GetSSLInfo(SSLInfo* ssl_info); |
| 53 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 54 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 54 virtual NextProtoStatus GetNextProto(std::string* proto); | 55 virtual NextProtoStatus GetNextProto(std::string* proto); |
| 55 virtual void UseDNSSEC(DNSSECProvider* provider); | 56 virtual void UseDNSSEC(DNSSECProvider* provider); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // is named after the similar kernel flag, TCP_CORK. | 151 // is named after the similar kernel flag, TCP_CORK. |
| 151 bool corked_; | 152 bool corked_; |
| 152 // uncork_timer_ is used to limit the amount of time that we'll delay the | 153 // uncork_timer_ is used to limit the amount of time that we'll delay the |
| 153 // Finished message while waiting for a Write. | 154 // Finished message while waiting for a Write. |
| 154 base::OneShotTimer<SSLClientSocketNSS> uncork_timer_; | 155 base::OneShotTimer<SSLClientSocketNSS> uncork_timer_; |
| 155 scoped_refptr<IOBuffer> recv_buffer_; | 156 scoped_refptr<IOBuffer> recv_buffer_; |
| 156 | 157 |
| 157 CompletionCallbackImpl<SSLClientSocketNSS> handshake_io_callback_; | 158 CompletionCallbackImpl<SSLClientSocketNSS> handshake_io_callback_; |
| 158 scoped_ptr<ClientSocketHandle> transport_; | 159 scoped_ptr<ClientSocketHandle> transport_; |
| 159 std::string hostname_; | 160 std::string hostname_; |
| 161 uint16 port_; |
| 160 SSLConfig ssl_config_; | 162 SSLConfig ssl_config_; |
| 161 | 163 |
| 162 CompletionCallback* user_connect_callback_; | 164 CompletionCallback* user_connect_callback_; |
| 163 CompletionCallback* user_read_callback_; | 165 CompletionCallback* user_read_callback_; |
| 164 CompletionCallback* user_write_callback_; | 166 CompletionCallback* user_write_callback_; |
| 165 | 167 |
| 166 // Used by Read function. | 168 // Used by Read function. |
| 167 scoped_refptr<IOBuffer> user_read_buf_; | 169 scoped_refptr<IOBuffer> user_read_buf_; |
| 168 int user_read_buf_len_; | 170 int user_read_buf_len_; |
| 169 | 171 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 std::string predicted_npn_proto_; | 246 std::string predicted_npn_proto_; |
| 245 bool predicted_npn_proto_used_; | 247 bool predicted_npn_proto_used_; |
| 246 | 248 |
| 247 scoped_ptr<SSLHostInfo> ssl_host_info_; | 249 scoped_ptr<SSLHostInfo> ssl_host_info_; |
| 248 DnsRRResolver* const dnsrr_resolver_; | 250 DnsRRResolver* const dnsrr_resolver_; |
| 249 }; | 251 }; |
| 250 | 252 |
| 251 } // namespace net | 253 } // namespace net |
| 252 | 254 |
| 253 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ | 255 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
| OLD | NEW |