ObjFW  Check-in [ef881e7270]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:OFGnuTLSTLSStream: Skip system trust for server
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ef881e727069d4bbda329e1d8e873f86396c993ee0ff8dd204a5c8c6959db145
User & Date: js 2024-11-30 18:25:27.387
Context
2024-12-07
16:24
Update ChangeLog for 1.2.2 check-in: 40c5b70095 user: js tags: trunk
2024-11-30
18:25
OFGnuTLSTLSStream: Skip system trust for server check-in: ef881e7270 user: js tags: trunk
18:15
OFTLSStream: Add server support check-in: 3cdd9960da user: js tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/tls/OFGnuTLSTLSStream.m.
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244

245
246
247
248
249
250
251
252

	gnutls_transport_set_ptr(_session, self);
	gnutls_transport_set_pull_function(_session, readFunc);
	gnutls_transport_set_push_function(_session, writeFunc);

	if (gnutls_set_default_priority(_session) != GNUTLS_E_SUCCESS ||
	    gnutls_certificate_allocate_credentials(&_credentials) !=
	    GNUTLS_E_SUCCESS ||
	    gnutls_certificate_set_x509_system_trust(_credentials) < 0)
		@throw [OFTLSHandshakeFailedException
		    exceptionWithStream: self
				   host: host
			      errorCode: initFailedErrorCode];

	_host = [host copy];
	_server = server;

	if (!server) {

		if (gnutls_server_name_set(_session, GNUTLS_NAME_DNS,
		    _host.UTF8String, _host.UTF8StringLength) !=
		    GNUTLS_E_SUCCESS)
			@throw [OFTLSHandshakeFailedException
			    exceptionWithStream: self
					   host: host
				      errorCode: initFailedErrorCode];








|
<









>
|







227
228
229
230
231
232
233
234

235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252

	gnutls_transport_set_ptr(_session, self);
	gnutls_transport_set_pull_function(_session, readFunc);
	gnutls_transport_set_push_function(_session, writeFunc);

	if (gnutls_set_default_priority(_session) != GNUTLS_E_SUCCESS ||
	    gnutls_certificate_allocate_credentials(&_credentials) !=
	    GNUTLS_E_SUCCESS)

		@throw [OFTLSHandshakeFailedException
		    exceptionWithStream: self
				   host: host
			      errorCode: initFailedErrorCode];

	_host = [host copy];
	_server = server;

	if (!server) {
		if (gnutls_certificate_set_x509_system_trust(_credentials) <
		    0 || gnutls_server_name_set(_session, GNUTLS_NAME_DNS,
		    _host.UTF8String, _host.UTF8StringLength) !=
		    GNUTLS_E_SUCCESS)
			@throw [OFTLSHandshakeFailedException
			    exceptionWithStream: self
					   host: host
				      errorCode: initFailedErrorCode];