ObjOpenSSL  Diff

Differences From Artifact [2c8d4cbc06]:

To Artifact [824fd754a6]:


102
103
104
105
106
107
108









109
110
111



112
113
114
115
116
117
118
	if (SSL_CTX_set_default_verify_paths(ctx) == 0)
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];
}

- initWithSocket: (OFTCPSocket*)socket
{









	self = [self init];

	@try {



		sock = dup(socket->sock);

		if ((ssl = SSL_new(ctx)) == NULL || !SSL_set_fd(ssl, sock)) {
			close(sock);
			sock = INVALID_SOCKET;
			@throw [OFInitializationFailedException
			    exceptionWithClass: isa];







>
>
>
>
>
>
>
>
>



>
>
>







102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
	if (SSL_CTX_set_default_verify_paths(ctx) == 0)
		@throw [OFInitializationFailedException
		    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;
			@throw [OFInitializationFailedException
			    exceptionWithClass: isa];