18 #include "mongo/config.h"
24 #include "mongo/base/disallow_copying.h"
25 #include "mongo/util/net/sock.h"
27 #include <openssl/err.h>
28 #include <openssl/ssl.h>
30 #endif // #ifdef MONGO_SSL
36 const std::string getSSLVersion(
const std::string& prefix,
const std::string& suffix);
49 SSLConnection(SSL_CTX* ctx, Socket* sock,
const char* initialBytes,
int len);
54 class SSLManagerInterface {
56 virtual ~SSLManagerInterface();
63 virtual SSLConnection* connect(Socket* socket) = 0;
70 virtual SSLConnection* accept(Socket* socket,
const char* initialBytes,
int len) = 0;
77 virtual std::string parseAndValidatePeerCertificate(
const SSLConnection* conn,
78 const std::string& remoteHost) = 0;
84 virtual void cleanupThreadLocals() = 0;
90 virtual std::string getServerSubjectName() = 0;
97 virtual std::string getClientSubjectName() = 0;
102 virtual std::string getSSLErrorMessage(
int code) = 0;
107 virtual int SSL_read(SSLConnection* conn,
void* buf,
int num) = 0;
109 virtual int SSL_write(SSLConnection* conn,
const void* buf,
int num) = 0;
111 virtual unsigned long ERR_get_error() = 0;
113 virtual char* ERR_error_string(
unsigned long e,
char* buf) = 0;
115 virtual int SSL_get_error(
const SSLConnection* conn,
int ret) = 0;
117 virtual int SSL_shutdown(SSLConnection* conn) = 0;
119 virtual void SSL_free(SSLConnection* conn) = 0;
123 SSLManagerInterface* getSSLManager();
125 #endif // #ifdef MONGO_SSL
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20