-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make verify_ssl=False turn off certificate verification too (#129)
- Loading branch information
1 parent
02f5626
commit ad248d6
Showing
5 changed files
with
73 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-----BEGIN EC PRIVATE KEY----- | ||
MHcCAQEEIIWkym77UXCR7NludcOuJyUc+KwjcWhNstarQewjH/4ZoAoGCCqGSM49 | ||
AwEHoUQDQgAELb4Nb3GZRIOgsiFCRPxEFXYYb9JIR/ViYM76/EKNII7nl5cLQaNG | ||
5BGo7ZVF47nePRerqzluEXHRTMt3oul2yw== | ||
-----END EC PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIBZzCCAQ6gAwIBAgIRAJL5RmnJTnoxpf27KVMMnecwCgYIKoZIzj0EAwIwDzEN | ||
MAsGA1UEChMEVGVzdDAgFw0yMDAzMTgyMTEyNDVaGA8yMTIwMDIyMzIxMTI0NVow | ||
DzENMAsGA1UEChMEVGVzdDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABC2+DW9x | ||
mUSDoLIhQkT8RBV2GG/SSEf1YmDO+vxCjSCO55eXC0GjRuQRqO2VReO53j0Xq6s5 | ||
bhFx0UzLd6LpdsujSTBHMA4GA1UdDwEB/wQEAwICpDATBgNVHSUEDDAKBggrBgEF | ||
BQcDATAPBgNVHRMBAf8EBTADAQH/MA8GA1UdEQQIMAaHBH8AAAEwCgYIKoZIzj0E | ||
AwIDRwAwRAIgXUpCMZGxpjXrWS9Z6K0fHzOAnMmjp78n8ZPMdRKb2eYCIBEmP6MK | ||
O3TJdhTVnB5O3CnC9X/lCGViUR+njcH+sU3z | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from ldclient.client import LDClient, Config | ||
from testing.http_util import start_secure_server | ||
import pytest | ||
import sys | ||
|
||
# These tests are skipped in Python 3.3 because the embedded HTTPS server does not work correctly, causing a | ||
# TLS handshake failure on the client side. It's unclear whether this is a problem with the self-signed | ||
# certificate we are using or with some other server settings, but it does not appear to be a client-side | ||
# problem. | ||
|
||
@pytest.mark.skipif(sys.version_info.major == 3 and sys.version_info.minor == 3, reason = "test is skipped in Python 3.3") | ||
def test_cannot_connect_with_selfsigned_cert_if_ssl_verify_is_true(): | ||
with start_secure_server() as server: | ||
server.setup_json_response('/sdk/latest-all', { 'flags': {}, 'segments': {} }) | ||
config = Config( | ||
sdk_key = 'sdk_key', | ||
base_uri = server.uri, | ||
stream = False | ||
) | ||
with LDClient(config = config, start_wait = 1.5) as client: | ||
assert not client.is_initialized() | ||
|
||
@pytest.mark.skipif(sys.version_info.major == 3 and sys.version_info.minor == 3, reason = "test is skipped in Python 3.3") | ||
def test_can_connect_with_selfsigned_cert_if_ssl_verify_is_false(): | ||
with start_secure_server() as server: | ||
server.setup_json_response('/sdk/latest-all', { 'flags': {}, 'segments': {} }) | ||
config = Config( | ||
sdk_key = 'sdk_key', | ||
base_uri = server.uri, | ||
stream = False, | ||
send_events = False, | ||
verify_ssl = False | ||
) | ||
with LDClient(config = config) as client: | ||
assert client.is_initialized() |