没有文档涵盖密码名称和curl期望作为参数的名称之间的所有转换。
幸运的是,卷曲是开源的,并且映射是在可用的源代码。
为了将来的搜索者的利益,我在这里更整洁地复制它:
SSL2密码套件
<argument> <name>
rc4 SSL_EN_RC4_128_WITH_MD5
rc4-md5 SSL_EN_RC4_128_WITH_MD5
rc4export SSL_EN_RC4_128_EXPORT40_WITH_MD5
rc2 SSL_EN_RC2_128_CBC_WITH_MD5
rc2export SSL_EN_RC2_128_CBC_EXPORT40_WITH_MD5
des SSL_EN_DES_64_CBC_WITH_MD5
desede3 SSL_EN_DES_192_EDE3_CBC_WITH_MD5
SSL3 / TLS密码套件
<argument> <name>
rsa_rc4_128_md5 SSL_RSA_WITH_RC4_128_MD5
rsa_rc4_128_sha SSL_RSA_WITH_RC4_128_SHA
rsa_3des_sha SSL_RSA_WITH_3DES_EDE_CBC_SHA
rsa_des_sha SSL_RSA_WITH_DES_CBC_SHA
rsa_rc4_40_md5 SSL_RSA_EXPORT_WITH_RC4_40_MD5
rsa_rc2_40_md5 SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
rsa_null_md5 SSL_RSA_WITH_NULL_MD5
rsa_null_sha SSL_RSA_WITH_NULL_SHA
fips_3des_sha SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA
fips_des_sha SSL_RSA_FIPS_WITH_DES_CBC_SHA
fortezza SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA
fortezza_rc4_128_sha SSL_FORTEZZA_DMS_WITH_RC4_128_SHA
fortezza_null SSL_FORTEZZA_DMS_WITH_NULL_SHA
TLS 1.0:可导出的56位密码套件。
<argument> <name>
rsa_des_56_sha TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA
rsa_rc4_56_sha TLS_RSA_EXPORT1024_WITH_RC4_56_SHA
AES密码。
<argument> <name>
dhe_dss_aes_128_cbc_sha TLS_DHE_DSS_WITH_AES_128_CBC_SHA
dhe_dss_aes_256_cbc_sha TLS_DHE_DSS_WITH_AES_256_CBC_SHA
dhe_rsa_aes_128_cbc_sha TLS_DHE_RSA_WITH_AES_128_CBC_SHA
dhe_rsa_aes_256_cbc_sha TLS_DHE_RSA_WITH_AES_256_CBC_SHA
rsa_aes_128_sha TLS_RSA_WITH_AES_128_CBC_SHA
rsa_aes_256_sha TLS_RSA_WITH_AES_256_CBC_SHA
ECC密码。
<argument> <name>
ecdh_ecdsa_null_sha TLS_ECDH_ECDSA_WITH_NULL_SHA
ecdh_ecdsa_rc4_128_sha TLS_ECDH_ECDSA_WITH_RC4_128_SHA
ecdh_ecdsa_3des_sha TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
ecdh_ecdsa_aes_128_sha TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
ecdh_ecdsa_aes_256_sha TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
ecdhe_ecdsa_null_sha TLS_ECDHE_ECDSA_WITH_NULL_SHA
ecdhe_ecdsa_rc4_128_sha TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
ecdhe_ecdsa_3des_sha TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
ecdhe_ecdsa_aes_128_sha TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
ecdhe_ecdsa_aes_256_sha TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
ecdh_rsa_null_sha TLS_ECDH_RSA_WITH_NULL_SHA
ecdh_rsa_128_sha TLS_ECDH_RSA_WITH_RC4_128_SHA
ecdh_rsa_3des_sha TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
ecdh_rsa_aes_128_sha TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
ecdh_rsa_aes_256_sha TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
echde_rsa_null TLS_ECDHE_RSA_WITH_NULL_SHA
ecdhe_rsa_rc4_128_sha TLS_ECDHE_RSA_WITH_RC4_128_SHA
ecdhe_rsa_3des_sha TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
ecdhe_rsa_aes_128_sha TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
ecdhe_rsa_aes_256_sha TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
ecdh_anon_null_sha TLS_ECDH_anon_WITH_NULL_SHA
ecdh_anon_rc4_128sha TLS_ECDH_anon_WITH_RC4_128_SHA
ecdh_anon_3des_sha TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA
ecdh_anon_aes_128_sha TLS_ECDH_anon_WITH_AES_128_CBC_SHA
ecdh_anon_aes_256_sha TLS_ECDH_anon_WITH_AES_256_CBC_SHA
RFC中指定的新HMAC-SHA256密码套件
<argument> <name>
rsa_null_sha_256 TLS_RSA_WITH_NULL_SHA256
rsa_aes_128_cbc_sha_256 TLS_RSA_WITH_AES_128_CBC_SHA256
rsa_aes_256_cbc_sha_256 TLS_RSA_WITH_AES_256_CBC_SHA256
dhe_rsa_aes_128_cbc_sha_256 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
dhe_rsa_aes_256_cbc_sha_256 TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
ecdhe_ecdsa_aes_128_cbc_sha_256 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
ecdhe_rsa_aes_128_cbc_sha_256 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
RFC 5288和RFC 5289中的AES GCM密码套件
<argument> <name>
rsa_aes_128_gcm_sha_256 TLS_RSA_WITH_AES_128_GCM_SHA256
dhe_rsa_aes_128_gcm_sha_256 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
dhe_dss_aes_128_gcm_sha_256 TLS_DHE_DSS_WITH_AES_128_GCM_SHA256
ecdhe_ecdsa_aes_128_gcm_sha_256 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
ecdh_ecdsa_aes_128_gcm_sha_256 TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
ecdhe_rsa_aes_128_gcm_sha_256 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
ecdh_rsa_aes_128_gcm_sha_256 TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
因此,如果要使用cipher TLS_DHE_RSA_WITH_AES_128_CBC_SHA
,则命令为:
curl --ciphers dhe_rsa_aes_128_cbc_sha <url>
为了指定多个密码,请用逗号分隔列表。因此,如果您也想使用密码TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
,则命令为:
curl --ciphers dhe_rsa_aes_128_cbc_sha,ecdh_rsa_aes_128_gcm_sha_256 <url>
要查看curl使用的密码列表,您将需要一个外部服务-像这样:
curl --ciphers ecdhe_rsa_aes_256_sha https://www.howsmyssl.com/a/check
尽管是NB,但该服务不接受所有密码,这意味着如果将连接限制为仅一个未使用的密码,则会收到错误“无法与对等方安全通信:没有通用的加密算法”,而不是响应。