Lines Matching defs:ssl
39 * The remote control utility contacts the unbound server over ssl and
49 #include <openssl/ssl.h>
131 /** exit with ssl error */
254 SSL* ssl;
258 ssl = SSL_new(ctx);
259 if(!ssl)
261 SSL_set_connect_state(ssl);
262 (void)SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
263 if(!SSL_set_fd(ssl, fd))
267 if( (r=SSL_do_handshake(ssl)) == 1)
269 r = SSL_get_error(ssl, r);
276 if(SSL_get_verify_result(ssl) != X509_V_OK)
279 x = SSL_get_peer_certificate(ssl);
285 return ssl;
290 send_file(SSL* ssl, FILE* in, char* buf, size_t sz)
293 if(SSL_write(ssl, buf, (int)strlen(buf)) <= 0)
300 go_cmd(SSL* ssl, int quiet, int argc, char* argv[])
309 if(SSL_write(ssl, pre, (int)strlen(pre)) <= 0)
312 if(SSL_write(ssl, space, (int)strlen(space)) <= 0)
314 if(SSL_write(ssl, argv[i], (int)strlen(argv[i])) <= 0)
317 if(SSL_write(ssl, newline, (int)strlen(newline)) <= 0)
321 send_file(ssl, stdin, buf, sizeof(buf));
326 if((r = SSL_read(ssl, buf, (int)sizeof(buf)-1)) <= 0) {
327 if(SSL_get_error(ssl, r) == SSL_ERROR_ZERO_RETURN) {
352 SSL* ssl;
365 ssl = setup_ssl(ctx, fd, cfg);
368 ret = go_cmd(ssl, quiet, argc, argv);
370 SSL_free(ssl);