Lines Matching refs:ssl

103 static void wait_for_activity(SSL *ssl, int write)  in wait_for_activity()  argument
109 sock = SSL_get_fd(ssl); in wait_for_activity()
138 static int handle_io_failure(SSL *ssl, int res) in handle_io_failure() argument
140 switch (SSL_get_error(ssl, res)) { in handle_io_failure()
143 wait_for_activity(ssl, 0); in handle_io_failure()
148 wait_for_activity(ssl, 1); in handle_io_failure()
163 if (SSL_get_verify_result(ssl) != X509_V_OK) in handle_io_failure()
165 X509_verify_cert_error_string(SSL_get_verify_result(ssl))); in handle_io_failure()
180 SSL *ssl = NULL; in main() local
244 ssl = SSL_new(ctx); in main()
245 if (ssl == NULL) { in main()
259 SSL_set_bio(ssl, bio, bio); in main()
265 if (!SSL_set_tlsext_host_name(ssl, hostname)) { in main()
276 if (!SSL_set1_host(ssl, hostname)) { in main()
282 while ((ret = SSL_connect(ssl)) != 1) { in main()
283 if (handle_io_failure(ssl, ret) == 1) in main()
290 while (!SSL_write_ex(ssl, request_start, strlen(request_start), &written)) { in main()
291 if (handle_io_failure(ssl, 0) == 1) in main()
296 while (!SSL_write_ex(ssl, hostname, strlen(hostname), &written)) { in main()
297 if (handle_io_failure(ssl, 0) == 1) in main()
302 while (!SSL_write_ex(ssl, request_end, strlen(request_end), &written)) { in main()
303 if (handle_io_failure(ssl, 0) == 1) in main()
314 while (!eof && !SSL_read_ex(ssl, buf, sizeof(buf), &readbytes)) { in main()
315 switch (handle_io_failure(ssl, 0)) { in main()
344 while ((ret = SSL_shutdown(ssl)) != 1) { in main()
345 if (ret < 0 && handle_io_failure(ssl, ret) == 1) in main()
373 SSL_free(ssl); in main()