unbound-control.c (5a2b666ce590a56f147e167aa07684af2d6b854a) unbound-control.c (b75612f8e7445139aa2b10038feab06da4b45cc1)
1/*
2 * checkconf/unbound-control.c - remote control utility for unbound.
3 *
4 * Copyright (c) 2008, NLnet Labs. All rights reserved.
5 *
6 * This software is open source.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 147 unchanged lines hidden (view full) ---

156 ctx = SSL_CTX_new(SSLv23_client_method());
157 if(!ctx)
158 ssl_err("could not allocate SSL_CTX pointer");
159 if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2))
160 ssl_err("could not set SSL_OP_NO_SSLv2");
161 if(cfg->remote_control_use_cert) {
162 if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3))
163 ssl_err("could not set SSL_OP_NO_SSLv3");
1/*
2 * checkconf/unbound-control.c - remote control utility for unbound.
3 *
4 * Copyright (c) 2008, NLnet Labs. All rights reserved.
5 *
6 * This software is open source.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 147 unchanged lines hidden (view full) ---

156 ctx = SSL_CTX_new(SSLv23_client_method());
157 if(!ctx)
158 ssl_err("could not allocate SSL_CTX pointer");
159 if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2))
160 ssl_err("could not set SSL_OP_NO_SSLv2");
161 if(cfg->remote_control_use_cert) {
162 if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3))
163 ssl_err("could not set SSL_OP_NO_SSLv3");
164 if(!SSL_CTX_use_certificate_file(ctx,c_cert,SSL_FILETYPE_PEM) ||
164 if(!SSL_CTX_use_certificate_chain_file(ctx,c_cert) ||
165 !SSL_CTX_use_PrivateKey_file(ctx,c_key,SSL_FILETYPE_PEM)
166 || !SSL_CTX_check_private_key(ctx))
167 ssl_err("Error setting up SSL_CTX client key and cert");
168 if (SSL_CTX_load_verify_locations(ctx, s_cert, NULL) != 1)
169 ssl_err("Error setting up SSL_CTX verify, server cert");
170 SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
171
172 free(s_cert);

--- 300 unchanged lines hidden ---
165 !SSL_CTX_use_PrivateKey_file(ctx,c_key,SSL_FILETYPE_PEM)
166 || !SSL_CTX_check_private_key(ctx))
167 ssl_err("Error setting up SSL_CTX client key and cert");
168 if (SSL_CTX_load_verify_locations(ctx, s_cert, NULL) != 1)
169 ssl_err("Error setting up SSL_CTX verify, server cert");
170 SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
171
172 free(s_cert);

--- 300 unchanged lines hidden ---