diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-12-08 11:31:35 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-12-08 11:31:35 +0000 |
commit | 315b61b3190f4b10f0710638bfaad27373fb3671 (patch) | |
tree | 27e9f5c30d51d8e3ecb0d0f6407104187597625c /src/libserver/maps | |
parent | 707357d35e12ee833f358418f380b685100e70b9 (diff) | |
download | rspamd-315b61b3190f4b10f0710638bfaad27373fb3671.tar.gz rspamd-315b61b3190f4b10f0710638bfaad27373fb3671.zip |
[Rework] Rework SSL flag operations
Diffstat (limited to 'src/libserver/maps')
-rw-r--r-- | src/libserver/maps/map.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c index 938f4a47f..531a7ce10 100644 --- a/src/libserver/maps/map.c +++ b/src/libserver/maps/map.c @@ -91,11 +91,6 @@ write_http_request (struct http_callback_data *cbd) struct rspamd_http_message *msg; msg = rspamd_http_new_message (HTTP_REQUEST); - - if (cbd->bk->protocol == MAP_PROTO_HTTPS) { - msg->flags |= RSPAMD_HTTP_FLAG_SSL; - } - if (cbd->check) { msg->method = HTTP_HEAD; } @@ -1268,6 +1263,9 @@ rspamd_map_dns_callback (struct rdns_reply *reply, void *arg) retry: msg_debug_map ("try open http connection to %s", rspamd_inet_address_to_string_pretty (cbd->addr)); + if (cbd->bk->protocol == MAP_PROTO_HTTPS) { + flags |= RSPAMD_HTTP_CLIENT_SSL; + } cbd->conn = rspamd_http_connection_new_client (NULL, NULL, http_map_error, @@ -1792,6 +1790,11 @@ check: strlen (data->host), RSPAMD_INET_ADDRESS_PARSE_DEFAULT)) { rspamd_inet_address_set_port (addr, cbd->data->port); g_ptr_array_add (cbd->addrs, (void *)addr); + + if (bk->protocol == MAP_PROTO_HTTPS) { + flags |= RSPAMD_HTTP_CLIENT_SSL; + } + cbd->conn = rspamd_http_connection_new_client ( NULL, NULL, |