Mac OS X Yosemite и клиентские SSL-сертификаты

3255
Nick Retallack

С тех пор, как я обновил Mavericks до Yosemite, мои SSL-сертификаты клиентов перестали работать в определенных местах. Они по-прежнему работают в веб-браузерах и в них wget, но перестали работать в curlи в requestsбиблиотеке Python .

Это работает:

$ wget https://localhost --certificate cert.pem --private-key private.pem 

Это не работает:

$ curl https://localhost --cert cert.pem --key private.pem curl: (58) SSL: Can't load the certificate "cert.pem" and its private key: OSStatus -25299 

Но все же, если я объединю pems в p12, это работает:

$ curl https://localhost --cert cert.p12:password 

Но Python не поддерживает p12s, и это не работает:

import requests print requests.get("https://localhost", cert=("cert.pem","private.pem")).content 

Не жалуется, но не отправляет сертификат клиента.

2

1 ответ на вопрос

1
Simon

Short answer: The new version of CURL uses Apple's Secure Transport API now instead of the OpenSSL API and you'll need to use the P12 format for certificates.

See the write up here: http://curl.haxx.se/mail/archive-2013-10/0036.html