Allow initializing with private key and certificate

This commit is contained in:
Florian Zeitz 2012-01-25 16:42:23 +01:00
parent 8c3b57e107
commit 38cd6bd401
2 changed files with 15 additions and 0 deletions

View file

@ -105,10 +105,22 @@ ssl_locking_callback(int mode, int n, const char *file, int line)
}
- initWithSocket: (OFTCPSocket*)socket
{
return [self initWithSocket: socket
privateKeyFile: nil
certificateFile: nil];
}
- initWithSocket: (OFTCPSocket*)socket
privateKeyFile: (OFString*)privateKeyFile_
certificateFile: (OFString*)certificateFile_
{
self = [self init];
@try {
privateKeyFile = privateKeyFile_;
certificateFile = certificateFile_;
sock = dup(socket->sock);
if ((ssl = SSL_new(ctx)) == NULL || !SSL_set_fd(ssl, sock)) {