mirror of
https://github.com/curl/curl.git
synced 2026-08-24 17:53:33 +03:00
SSL: Add an option to disable certificate revocation checks
New tool option --ssl-no-revoke. New value CURLSSLOPT_NO_REVOKE for CURLOPT_SSL_OPTIONS. Currently this option applies only to WinSSL where we have automatic certificate revocation checking by default. According to the ssl-compared chart there are other backends that have automatic checking (NSS, wolfSSL and DarwinSSL) so we could possibly accommodate them at some later point. Bug: https://github.com/bagder/curl/issues/264 Reported-by: zenden2k <zenden2k@gmail.com>
This commit is contained in:
parent
606b29fe0d
commit
172b2beba6
15 changed files with 129 additions and 23 deletions
|
|
@ -199,6 +199,7 @@ struct OperationConfig {
|
|||
bool xattr; /* store metadata in extended attributes */
|
||||
long gssapi_delegation;
|
||||
bool ssl_allow_beast; /* allow this SSL vulnerability */
|
||||
bool ssl_no_revoke; /* disable SSL certificate revocation checks */
|
||||
|
||||
bool use_metalink; /* process given URLs as metalink XML file */
|
||||
metalinkfile *metalinkfile_list; /* point to the first node */
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ static const struct LongShort aliases[]= {
|
|||
{"Ep", "pinnedpubkey", TRUE},
|
||||
{"Eq", "cert-status", FALSE},
|
||||
{"Er", "false-start", FALSE},
|
||||
{"Es", "ssl-no-revoke", FALSE},
|
||||
{"f", "fail", FALSE},
|
||||
{"F", "form", TRUE},
|
||||
{"Fs", "form-string", TRUE},
|
||||
|
|
@ -1382,6 +1383,11 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
config->falsestart = TRUE;
|
||||
break;
|
||||
|
||||
case 's': /* --ssl-no-revoke */
|
||||
if(curlinfo->features & CURL_VERSION_SSL)
|
||||
config->ssl_no_revoke = TRUE;
|
||||
break;
|
||||
|
||||
default: /* certificate file */
|
||||
{
|
||||
char *certname, *passphrase;
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@ static const char *const helptext[] = {
|
|||
" -2, --sslv2 Use SSLv2 (SSL)",
|
||||
" -3, --sslv3 Use SSLv3 (SSL)",
|
||||
" --ssl-allow-beast Allow security flaw to improve interop (SSL)",
|
||||
" --ssl-no-revoke Disable cert revocation checks (WinSSL)",
|
||||
" --stderr FILE Where to redirect stderr (use \"-\" for stdout)",
|
||||
" --tcp-nodelay Use the TCP_NODELAY option",
|
||||
" -t, --telnet-option OPT=VAL Set telnet option",
|
||||
|
|
|
|||
|
|
@ -1328,8 +1328,9 @@ static CURLcode operate_do(struct GlobalConfig *global,
|
|||
config->gssapi_delegation);
|
||||
|
||||
/* new in 7.25.0 */
|
||||
if(config->ssl_allow_beast)
|
||||
my_setopt(curl, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_ALLOW_BEAST);
|
||||
my_setopt_bitmask(curl, CURLOPT_SSL_OPTIONS,
|
||||
(long)((config->ssl_allow_beast ? CURLSSLOPT_ALLOW_BEAST : 0) |
|
||||
(config->ssl_no_revoke ? CURLSSLOPT_NO_REVOKE : 0)));
|
||||
|
||||
if(config->mail_auth)
|
||||
my_setopt_str(curl, CURLOPT_MAIL_AUTH, config->mail_auth);
|
||||
|
|
|
|||
|
|
@ -107,6 +107,12 @@ const NameValue setopt_nv_CURLUSESSL[] = {
|
|||
NVEND,
|
||||
};
|
||||
|
||||
const NameValueUnsigned setopt_nv_CURLSSLOPT[] = {
|
||||
NV(CURLSSLOPT_ALLOW_BEAST),
|
||||
NV(CURLSSLOPT_NO_REVOKE),
|
||||
NVEND,
|
||||
};
|
||||
|
||||
const NameValue setopt_nv_CURL_NETRC[] = {
|
||||
NV(CURL_NETRC_IGNORED),
|
||||
NV(CURL_NETRC_OPTIONAL),
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ extern const NameValue setopt_nv_CURL_SSLVERSION[];
|
|||
extern const NameValue setopt_nv_CURL_TIMECOND[];
|
||||
extern const NameValue setopt_nv_CURLFTPSSL_CCC[];
|
||||
extern const NameValue setopt_nv_CURLUSESSL[];
|
||||
extern const NameValueUnsigned setopt_nv_CURLSSLOPT[];
|
||||
extern const NameValue setopt_nv_CURL_NETRC[];
|
||||
extern const NameValue setopt_nv_CURLPROTO[];
|
||||
extern const NameValueUnsigned setopt_nv_CURLAUTH[];
|
||||
|
|
@ -63,6 +64,7 @@ extern const NameValueUnsigned setopt_nv_CURLAUTH[];
|
|||
#define setopt_nv_CURLOPT_TIMECONDITION setopt_nv_CURL_TIMECOND
|
||||
#define setopt_nv_CURLOPT_FTP_SSL_CCC setopt_nv_CURLFTPSSL_CCC
|
||||
#define setopt_nv_CURLOPT_USE_SSL setopt_nv_CURLUSESSL
|
||||
#define setopt_nv_CURLOPT_SSL_OPTIONS setopt_nv_CURLSSLOPT
|
||||
#define setopt_nv_CURLOPT_NETRC setopt_nv_CURL_NETRC
|
||||
#define setopt_nv_CURLOPT_PROTOCOLS setopt_nv_CURLPROTO
|
||||
#define setopt_nv_CURLOPT_REDIR_PROTOCOLS setopt_nv_CURLPROTO
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue