Thursday, November 3, 2016

django 1.10 error (SSL error: called a function you should not call)

Hello,

I have a Python 3.5/Django 1.10 app served by Apache/mod_wsgi over SSL. It is connected to a Postgres 9.5.2 database (with psycopg2==2.6.2) and is running on a server at AlwaysData

It works fine most of time but I have sometimes an error that I don't understand. 

(SSL error: called a function you should not call)

It seems to occur while querying the database.

# django/db/backends/utils.py line 64  return self.cursor.execute(sql, params)

The problem occurs when REST api (made using django-rest-framework) is called by a Angular2 app.

I have activated the following settings:

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')  SECURE_SSL_REDIRECT = True  SESSION_COOKIE_SECURE = True  CSRF_COOKIE_SECURE = True
Does anybody have any idea about the possible cause of the problem?

Best
luc

No comments:

Post a Comment