Hallo,
ich hoffe, mir kann jemand bei meinem WinHTTP-Secure-Problem helfen.
Bisher funktionierte bei HTTPS-Requests mein Code (siehe Spoiler). Jetzt wurde die Verschlüsselung auf TLS1.1 geändert, und der _WinHttpSendRequest läuft auf einen Fehler. Wo kann ich die Verschlüsselung anpassen?
Im Internet finde ich zu dem Thema den Hinweis, das die Security-Optionen mit Hilfe der Funktionen WinHttpQueryOption bzw. WinHttpSetOption zu ändern sind.
Doku-Ausschnitt:
WINHTTP_OPTION_SECURE_PROTOCOLS
Sets an unsigned long integer value that specifies which secure
protocols are acceptable. By default only SSL3 and TLS1 are enabled.
Can by a combination of one or more of the following values.
WINHTTP_FLAG_SECURE_PROTOCOL_ALL
The Secure Sockets Layer (SSL) 2.0, SSL 3.0, and Transport Layer Security (TLS) 1.0 protocols can be used.
WINHTTP_FLAG_SECURE_PROTOCOL_SSL2
The SSL 2.0 protocol can be used.
WINHTTP_FLAG_SECURE_PROTOCOL_SSL3
The SSL 3.0 protocol can be used.
WINHTTP_FLAG_SECURE_PROTOCOL_TLS1
The TLS 1.0 protocol can be used.
WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1
The TLS 1.1 protocol can be used.
WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2
The TLS 1.2 protocol can be used.
Wo kann ich diese Werte setzen? In den WinHttpConstants finde ich keine entsprechenden Konstanten.
Vielen Dank schon mal im voraus
Spoiler anzeigen
Local $hRequest = _WinHttpOpenRequest($hConnect, "GET", "https://xyz.de", Default, Default, Default, $WINHTTP_FLAG_SECURE)
_WinHttpSetOption($hRequest, $WINHTTP_OPTION_SECURITY_FLAGS, BitOR($SECURITY_FLAG_IGNORE_CERT_CN_INVALID, $SECURITY_FLAG_IGNORE_UNKNOWN_CA))