aykevl / mta-sts

Online tool for MTA-STS checking: https://aykevl.nl/apps/mta-sts/
BSD 2-Clause "Simplified" License
39 stars 12 forks source link

SSL connect failure when searching for policy file. #3

Open ghost opened 6 years ago

ghost commented 6 years ago

Error: SSL error while connecting to the HTTPS server: TLSV1_ALERT_INTERNAL_ERROR.

aykevl commented 6 years ago

On which domain do you have this issue?

ghost commented 6 years ago

raidensnakesden.net This is the server I'm testing. The DNS records work just fine. It's when it comes to the policy file.

aykevl commented 6 years ago

Sorry for the long delay. The report says the following (with a few updates today):

Policy: https://mta-sts.raidensnakesden.net/.well-known/mta-sts.txt

Error: Could not connect to the HTTPS server: timed out.

This means that the URL is unresolvable. This is easy to test: it also times out in a browser. So this means you'll have to get the URL to work, probably by fixing the HTTPS server.

ghost commented 6 years ago

apologies the datacentre were doing some network updates and the server lost connection for about an hour.

aykevl commented 6 years ago

Ah I see, that's unfortunate. Yeah, now the URL resolves in a browser but not in the tool. I'm looking into it.

ghost commented 6 years ago

yeah not sure why.

aykevl commented 6 years ago

Reopening. I'll look into this later.

aykevl commented 6 years ago

Fixed the issue. It's probably a bug in Python 3.5 that has been fixed in Python 3.6. I'm now running the verifier in Python 3.6.

Raito00 commented 3 years ago

Whe i test my site the same problem! Error: Got a non-OK status code from the server: 403.

but when i open with browser all is OK

Policy: https://mta-sts.smiltene.lv/.well-known/mta-sts.txt

Error: Got a non-OK status code from the server: 403.

klausenbusk commented 3 years ago

Error: Got a non-OK status code from the server: 403.

The issue seems to be the lack of a User-Agent:

import http.client

conn = http.client.HTTPSConnection("mta-sts.smiltene.lv", 443)
conn.request("GET","/.well-known/mta-sts.txt")

r1 = conn.getresponse()
print(r1.status, r1.reason)
r1.read()

conn.request("GET","/.well-known/mta-sts.txt", headers={"user-agent": "something"})
r2 = conn.getresponse()
print(r2.status, r2.reason)
$ python test.py
403 Forbidden
200 OK
klausenbusk commented 3 years ago

PR opened: https://github.com/aykevl/mta-sts/pull/12