Skip to content

Instantly share code, notes, and snippets.

@lega911
Created August 7, 2020 09:09
Show Gist options
  • Save lega911/4606bdf38fc441ad106af151c9a33e7d to your computer and use it in GitHub Desktop.
Save lega911/4606bdf38fc441ad106af151c9a33e7d to your computer and use it in GitHub Desktop.
test connection to web.smscom.se
import requests
import time
def main():
ok = 0
fail = 0
for i in range(1000):
try:
r = requests.post('https://web.smscom.se/sendSms/sendSms.asmx')
print(i, r, r.content[:100] + b'...')
ok += 1
except requests.exceptions.SSLError as e:
print(i, '--- ERROR ---', e)
fail += 1
time.sleep(0.1)
print(f'ok {ok}, fail {fail}')
main()
@lega911
Copy link
Author

lega911 commented Aug 7, 2020

Result: 48% SSL errors.

Test system: Amazon EC2 Stockholm, Ubuntu 20.04.1 LTS, Python 3.8.2 (all fresh upgraded)

part of logs:

964 --- ERROR --- HTTPSConnectionPool(host='web.smscom.se', port=443): Max retries exceeded with url: /sendSms/sendSms.asmx (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
965 --- ERROR --- HTTPSConnectionPool(host='web.smscom.se', port=443): Max retries exceeded with url: /sendSms/sendSms.asmx (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
966 --- ERROR --- HTTPSConnectionPool(host='web.smscom.se', port=443): Max retries exceeded with url: /sendSms/sendSms.asmx (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
967 --- ERROR --- HTTPSConnectionPool(host='web.smscom.se', port=443): Max retries exceeded with url: /sendSms/sendSms.asmx (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
968 <Response [500]> b'<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-enve...'
969 <Response [500]> b'<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-enve...'
...
999 <Response [500]> b'<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-enve...'

ok 520, fail 480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment