File tree 2 files changed +9
-7
lines changed
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ __ustream_ssl_context_new(bool server)
95
95
if (!ctx )
96
96
return NULL ;
97
97
98
+ ctx -> auth = SSL_VERIFY_NONE ;
98
99
ctx -> server = server ;
99
100
#ifdef USE_VERSION_1_3
100
101
pk_init (& ctx -> key );
@@ -117,6 +118,9 @@ __hidden int __ustream_ssl_set_crt_file(struct ustream_ssl_ctx *ctx, const char
117
118
if (ret )
118
119
return -1 ;
119
120
121
+ if (!ctx -> server )
122
+ ctx -> auth = SSL_VERIFY_OPTIONAL ;
123
+
120
124
return 0 ;
121
125
}
122
126
@@ -256,7 +260,7 @@ static const int default_ciphersuites[] =
256
260
__hidden void * __ustream_ssl_session_new (struct ustream_ssl_ctx * ctx )
257
261
{
258
262
ssl_context * ssl ;
259
- int ep , auth ;
263
+ int ep ;
260
264
261
265
ssl = calloc (1 , sizeof (ssl_context ));
262
266
if (!ssl )
@@ -267,17 +271,14 @@ __hidden void *__ustream_ssl_session_new(struct ustream_ssl_ctx *ctx)
267
271
return NULL ;
268
272
}
269
273
270
- if (ctx -> server ) {
274
+ if (ctx -> server )
271
275
ep = SSL_IS_SERVER ;
272
- auth = SSL_VERIFY_NONE ;
273
- } else {
276
+ else
274
277
ep = SSL_IS_CLIENT ;
275
- auth = SSL_VERIFY_OPTIONAL ;
276
- }
277
278
278
279
ssl_set_ciphersuites (ssl , default_ciphersuites );
279
280
ssl_set_endpoint (ssl , ep );
280
- ssl_set_authmode (ssl , auth );
281
+ ssl_set_authmode (ssl , ctx -> auth );
281
282
ssl_set_rng (ssl , _urandom , NULL );
282
283
283
284
if (ctx -> server ) {
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ struct ustream_ssl_ctx {
40
40
rsa_context key ;
41
41
#endif
42
42
x509_crt cert ;
43
+ int auth ;
43
44
bool server ;
44
45
};
45
46
You can’t perform that action at this time.
0 commit comments