diff --git a/src/puppy/platforms/win32/platform.nim b/src/puppy/platforms/win32/platform.nim index 19e1282..1acffb2 100644 --- a/src/puppy/platforms/win32/platform.nim +++ b/src/puppy/platforms/win32/platform.nim @@ -116,7 +116,7 @@ proc fetch*(req: Request): Response {.raises: [PuppyError].} = ) == 0: let error = GetLastError() - if error in {ERROR_WINHTTP_SECURE_FAILURE, ERROR_INTERNET_INVALID_CA} and + if error in {ERROR_WINHTTP_SECURE_FAILURE, ERROR_INTERNET_INVALID_CA, ERROR_INTERNET_SEC_CERT_DATE_INVALID, ERROR_INTERNET_SEC_INVALID_CERT, ERROR_INTERNET_SEC_CERT_CN_INVALID, ERROR_INTERNET_SEC_CERT_NO_REV, ERROR_INTERNET_SEC_CERT_REV_FAILED, ERROR_INTERNET_SEC_CERT_REVOKED, ERROR_INTERNET_SEC_CERT_ERRORS} and req.allowAnyHttpsCertificate: # If this is a certificate error but we should allow any HTTPS cert, # we need to set some options and retry sending the request. diff --git a/src/puppy/platforms/win32/windefs.nim b/src/puppy/platforms/win32/windefs.nim index 253f241..802fa34 100644 --- a/src/puppy/platforms/win32/windefs.nim +++ b/src/puppy/platforms/win32/windefs.nim @@ -33,6 +33,14 @@ const ERROR_INSUFFICIENT_BUFFER* = 122 ERROR_WINHTTP_SECURE_FAILURE* = 12175 ERROR_INTERNET_INVALID_CA* = 12045 + ERROR_INTERNET_SEC_CERT_DATE_INVALID* = 12037 + ERROR_INTERNET_SEC_INVALID_CERT* = 12169 + ERROR_INTERNET_SEC_CERT_ERRORS* = 12055 + ERROR_INTERNET_SEC_CERT_NO_REV* = 12056 + ERROR_INTERNET_SEC_CERT_CN_INVALID* = 12038 + ERROR_INTERNET_SEC_CERT_REV_FAILED* = 12057 + ERROR_INTERNET_SEC_CERT_REVOKED* = 12170 + WINHTTP_OPTION_SECURITY_FLAGS* = 31 SECURITY_FLAG_IGNORE_UNKNOWN_CA* = 0x00000100 # SECURITY_FLAG_IGNORE_WRONG_USAGE* = 0x00000200