Forums

SSLError

Hello fine sirs,

I received a notification from a monitoring tool that my site was down and when I tried to visit the site it took a long time to load but eventually did so. I looked at the error log and there are a whole lot of the below error. Not sure if this is just a red herring or not but I haven't seen this before.

I looked at some Stack Overflow threads and there are some posts in relation to requests. I am don't think I am explicitly using requests anywhere. Any thoughts on where this could be coming from? Also I cant find this in Sentry anywhere... is that strange?

I don't recognise /api/1298301/store/ which looks like the URL that causes the error

Thank you

2018-11-22 05:03:22,775: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:749)'),)': /api/1298301/store/

2018-11-22 05:18:22,575: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:749)'),)': /api/1298301/store/

That looks like it's coming from some code you're using to connect to an an external API of some kind, which might be using requests under the hood -- is that something you're doing in your code?

I don't think so, the only API I am connecting to is stripe via dj-stripe.

I am also noticing periodic attempts to access what could be vulnerabilities so am wondering if this is security related. The requests include:

wp-login.php xmlrpc.php /.git/config/ /js/'+j+'

Pretty-much any site that is on the net for any length of time is going to get probed for vulnerabilities. Thankfully, the vast majority of probes are looking for vulnerabilities in out-of-date WordPress and PHP sites, so you don't need to worry about them.

As to the SSL errors, I can think of 2 possibilities:

  1. dj-stripe is making requests to Stripe that are failing
  2. Stripe is making webhook calls to your site and those are failing.

I think 1 is the most likely, so you should start your investigations there.

Yes I thought that was the case.

Okay thanks glenn... to be honest I am not really sure where to start trouble shooting failing requests from dj-stripe but will have a look around. Logs look fine for the webhooks... only 3 errrors over the past month

It's a bit odd that the errors aren't being presented alongside stack traces, which would help you track down exactly where they're happening in your code. Perhaps you could add some error logging of your own? If you put something like this in your code:

sys.stderr.write("{}: logging message\n".format(datetime.now())
sys.stderr.flush()

...with the appropriate imports at the top of the file, of course:

from datetime import datetime
import sys

....then you'll get timestamped messages in the error log. If you put those before any after your calls to dj-stripe functions, that might help you work out which ones are causing those error messages.