ObjOpenSSL  Check-in [2c543487d3]

Overview
Comment:Use certificate / key in client mode if set.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2c543487d38523565802264c72a79684de69a197b4483d1d11269903fc30f129
User & Date: js on 2011-06-13 16:14:19
Other Links: manifest | tags
Context
2011-09-09
18:01
Support for getting channel binding data check-in: a1f0209e57 user: florob@babelmonkeys.de tags: trunk
2011-06-13
16:14
Use certificate / key in client mode if set. check-in: 2c543487d3 user: js tags: trunk
2011-06-08
21:24
Add copyright and license. check-in: 2110030291 user: js tags: trunk
Changes

Modified src/SSLSocket.m from [9dc998cc98] to [772a7418de].

75
76
77
78
79
80
81




82
83
84
85
86
87
88
89
			sock = INVALID_SOCKET;
			@throw [OFInitializationFailedException
			    newWithClass: isa];
		}

		SSL_set_connect_state(ssl);





		if (SSL_connect(ssl) != 1) {
			close(sock);
			sock = INVALID_SOCKET;
			@throw [OFInitializationFailedException
			    newWithClass: isa];
		}
	} @catch (id e) {
		[self release];







>
>
>
>
|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
			sock = INVALID_SOCKET;
			@throw [OFInitializationFailedException
			    newWithClass: isa];
		}

		SSL_set_connect_state(ssl);

		if ((privateKeyFile != nil && !SSL_use_PrivateKey_file(ssl,
		    [privateKeyFile cString], SSL_FILETYPE_PEM)) ||
		    (certificateFile != nil && !SSL_use_certificate_file(ssl,
		    [certificateFile cString], SSL_FILETYPE_PEM)) ||
		    SSL_connect(ssl) != 1) {
			close(sock);
			sock = INVALID_SOCKET;
			@throw [OFInitializationFailedException
			    newWithClass: isa];
		}
	} @catch (id e) {
		[self release];
118
119
120
121
122
123
124




125
126
127
128
129
130
131
132
							  socket: self
							    host: host
							    port: port];
	}

	SSL_set_connect_state(ssl);





	if (SSL_connect(ssl) != 1) {
		[super close];
		@throw [OFConnectionFailedException newWithClass: isa
							  socket: self
							    host: host
							    port: port];
	}
}







>
>
>
>
|







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
							  socket: self
							    host: host
							    port: port];
	}

	SSL_set_connect_state(ssl);

	if ((privateKeyFile != nil && !SSL_use_PrivateKey_file(ssl,
	    [privateKeyFile cString], SSL_FILETYPE_PEM)) ||
	    (certificateFile != nil && !SSL_use_certificate_file(ssl,
	    [certificateFile cString], SSL_FILETYPE_PEM)) ||
	    SSL_connect(ssl) != 1) {
		[super close];
		@throw [OFConnectionFailedException newWithClass: isa
							  socket: self
							    host: host
							    port: port];
	}
}