From 0e59195642eb26263b8e0b9200290538631d35cd Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 2 May 2014 15:37:02 +0200 Subject: http: Add HTTP_FLAG_FORCE_TLS and http_get_tls_info. * common/http.c (http_parse_uri): Factor code out to ... (parse_uri): here. Add arg FORCE_TLS. (do_parse_uri): Ditto. Implement flag. (http_get_tls_info): New. (http_register_tls_ca): Allow clearing of the list. (send_request): Use a default verification function. * common/http.h (HTTP_FLAG_FORCE_TLS): New. * common/t-http.c (main): Add several command line options. --- common/http.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common/http.h') diff --git a/common/http.h b/common/http.h index e38fadcf4..fa73b6e59 100644 --- a/common/http.h +++ b/common/http.h @@ -77,6 +77,7 @@ enum HTTP_FLAG_TRY_PROXY = 1, /* Try to use a proxy. */ HTTP_FLAG_SHUTDOWN = 2, /* Close sending end after the request. */ HTTP_FLAG_LOG_RESP = 8, /* Log the server respone. */ + HTTP_FLAG_FORCE_TLS = 16, /* Force the use opf TLS. */ HTTP_FLAG_IGNORE_CL = 32, /* Ignore content-length. */ HTTP_FLAG_IGNORE_IPv4 = 64, /* Do not use IPv4. */ HTTP_FLAG_IGNORE_IPv6 = 128 /* Do not use IPv6. */ @@ -133,6 +134,7 @@ gpg_error_t http_open_document (http_t *r_hd, estream_t http_get_read_ptr (http_t hd); estream_t http_get_write_ptr (http_t hd); unsigned int http_get_status_code (http_t hd); +const char *http_get_tls_info (http_t hd, const char *what); const char *http_get_header (http_t hd, const char *name); const char **http_get_header_names (http_t hd); gpg_error_t http_verify_server_credentials (http_session_t sess); -- cgit v1.2.3