sslv3 alarm handshake failure (_ssl.c: 590)?

5686
jack lucky

Das ist mein Code:

def test(request): paypalrestsdk.configure({ "mode": "security-test-sandbox", "client_id": "XXXXXXX-XXXX-XXXX-XXXX", "client_secret": "XXXXXXX-XXXX-XXXX-XXXX" })  payment = paypalrestsdk.Payment({ "intent": "sale", "payer": { "payment_method": "credit_card", "funding_instruments": [{ "credit_card": { "type": "visa", "number": "4417119669820331", "expire_month": "11", "expire_year": "2018", "cvv2": "874", "first_name": "Joe", "last_name": "Shopper" }}]}, "transactions": [{ "item_list": { "items": [{ "name": "item", "sku": "item", "price": "1.00", "currency": "USD", "quantity": 1 }]}, "amount": { "total": "1.00", "currency": "USD" }, "description": "This is the payment transaction description." }]})  if payment.create(): print("Payment created successfully") else: print(payment.error) return render(request, "test.html") 

Beim Ausführen des Befehls payment.create () wird folgender Fehler ausgegeben: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] Fehler beim Handshake-Alarm für sslv3 (_ssl.c: 590). Ich benutze Mac. bitte erzähle mir warum?

0

1 Antwort auf die Frage

3
JimJty

Ich hatte das gleiche Problem und das ist, was ich gefunden habe und wie ich es behoben habe:

Die von Apple bereitgestellte Python-Version ist in Bezug auf openssl nicht mehr aktuell. Sie können Ihre Version testen, indem Sie in terminal gehen:

python >>> import ssl >>> print ssl.OPENSSL_VERSION OpenSSL 0.9.8zh 14 Jan 2016 

Oben ist die schlechte Version. Ein Update ist die Installation einer neuen Version von Python. Am einfachsten ist es wahrscheinlich, das hier beschriebene Home Brew zu verwenden .

Unten ist ähnlich wie bei einer aktualisierten Version von Python. Dann funktioniert der paypalrestsdk.

python >>> import ssl >>> print ssl.OPENSSL_VERSION OpenSSL 1.0.2h 3 May 2016