diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 21:52:27 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 21:52:27 +0000 |
commit | b28f19d7901a742c41987c707168f9f71dc3ea0e (patch) | |
tree | f0b8d142fa83c8b161ffac4f1b472e38c7811af5 /net/socket/ssl_client_socket.h | |
parent | e1b19760199e7a1004684840c1641f934029f27a (diff) | |
download | chromium_src-b28f19d7901a742c41987c707168f9f71dc3ea0e.zip chromium_src-b28f19d7901a742c41987c707168f9f71dc3ea0e.tar.gz chromium_src-b28f19d7901a742c41987c707168f9f71dc3ea0e.tar.bz2 |
Add GetNextProtocol method to SSLClientSocket.
http://codereview.chromium.org/484005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34288 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/ssl_client_socket.h')
-rw-r--r-- | net/socket/ssl_client_socket.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h index 1b12ebc..4ad0320 100644 --- a/net/socket/ssl_client_socket.h +++ b/net/socket/ssl_client_socket.h @@ -20,6 +20,16 @@ class SSLInfo; // class SSLClientSocket : public ClientSocket { public: + // Next Protocol Negotiation (NPN) allows a TLS client and server to come to + // an agreement about the application level protocol to speak over a + // connection. + enum NextProtoStatus { + kNextProtoUnsupported = 0, // The server doesn't support NPN. + kNextProtoNegotiated = 1, // We agreed on a protocol. + kNextProtoNoOverlap = 2, // No protocols in common. We requested + // the first protocol in our list. + }; + // Next Protocol Negotiation (NPN), if successful, results in agreement on an // application-level string that specifies the application level protocol to // use over the TLS connection. NextProto enumerates the application level @@ -38,6 +48,15 @@ class SSLClientSocket : public ClientSocket { virtual void GetSSLCertRequestInfo( SSLCertRequestInfo* cert_request_info) = 0; + // Get the application level protocol that we negotiated with the server. + // *proto is set to the resulting protocol (n.b. that the string may have + // embedded NULs). + // kNextProtoUnsupported: *proto is cleared. + // kNextProtoNegotiated: *proto is set to the negotiated protocol. + // kNextProtoNoOverlap: *proto is set to the first protocol in the + // supported list. + virtual NextProtoStatus GetNextProtocol(std::string* proto) = 0; + static NextProto NextProtoFromString(const std::string& proto_string) { if (proto_string == "http1.1") { return kProtoHTTP11; |