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

Unified Diff: net/socket/ssl_server_socket.h

Issue 5746003: Defines SSLServerSocket and implements SSLServerSocketNSS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 10 years 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
Index: net/socket/ssl_server_socket.h
diff --git a/net/socket/ssl_server_socket.h b/net/socket/ssl_server_socket.h
new file mode 100644
index 0000000000000000000000000000000000000000..7c44a9c88bed737a65e935135580f336666e715e
--- /dev/null
+++ b/net/socket/ssl_server_socket.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2010 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 NET_SOCKET_SSL_SERVER_SOCKET_H_
+#define NET_SOCKET_SSL_SERVER_SOCKET_H_
+
+#include "base/basictypes.h"
+#include "net/base/completion_callback.h"
+#include "net/socket/socket.h"
+
+namespace base {
+class RSAPrivateKey;
+} // namespace base
+
+namespace net {
+
+class IOBuffer;
+class X509Certificate;
+
+// SSLServerSocket takes an already connected socket and performs SSL on top of
+// it.
+//
+// This class is designed to work in peer-to-peer connection in pair with
agl 2010/12/17 18:30:50 s/in/in a/
+// SSLClientSocket and is not intended to be used as a standaline SSL server.
wtc 2010/12/17 18:08:04 Remove "in pair with SSLClientSocket", because the
agl 2010/12/17 18:30:50 s/standaline/standalone/
Alpha Left Google 2010/12/17 20:31:12 Done.
Alpha Left Google 2010/12/17 20:31:12 Done.
+class SSLServerSocket : public Socket {
+ public:
+ virtual ~SSLServerSocket() {}
+
+ // Performs SSL server handshaking on an existing socket. The socket given
agl 2010/12/17 18:30:50 "Performs an SSL server handshake on the existing
Alpha Left Google 2010/12/17 20:31:12 Done.
+ // to this object has to be already connected.
+ //
+ // This method takes a callback. Return true value of this method is the
agl 2010/12/17 18:30:50 "Accept either returns ERR_IO_PENDING, in which ca
Alpha Left Google 2010/12/17 20:31:12 Done.
+ // error code of the handshaking operation. If the return value is
+ // net::ERR_IO_PENDING the given callback will be invoked in the future with
+ // an error code. Other values of error code returned by this method indicate
+ // the handshaking operation has completed synchronously.
+ virtual int Accept(CompletionCallback* callback) = 0;
+};
+
+// Creates an SSL server socket using an already connected socket. A certificate
+// and private key needs to be provided.
+//
+// This created server socket will take ownership of |socket|. However |key|
+// is copied.
+// TODO(hclam): Defines ServerSocketFactory to create SSLServerSocket. This will
+// make mocking easier.
+SSLServerSocket* CreateSSLServerSocket(
+ Socket* socket, X509Certificate* certificate, base::RSAPrivateKey* key);
+
+} // namespace net
+
+#endif // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_

Powered by Google App Engine
This is Rietveld 408576698