Index: src/SSLSocket.h ================================================================== --- src/SSLSocket.h +++ src/SSLSocket.h @@ -37,10 +37,13 @@ @property (copy) OFString *privateKeyFile; @property (copy) OFString *certificateFile; #endif - initWithSocket: (OFTCPSocket*)socket; +- initWithSocket: (OFTCPSocket*)socket + privateKeyFile: (OFString*)privateKeyFile + certificateFile: (OFString*)certificateFile; /* Change the return type */ - (SSLSocket*)accept; - (void)setPrivateKeyFile: (OFString*)file; - (OFString*)privateKeyFile; - (void)setCertificateFile: (OFString*)file; Index: src/SSLSocket.m ================================================================== --- src/SSLSocket.m +++ src/SSLSocket.m @@ -104,13 +104,25 @@ exceptionWithClass: self]; } - 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)) { close(sock); sock = INVALID_SOCKET;