Reputation: 11948
I'm connecting to a MySQL database for OTP using this gramex.yaml
configuration:
otp:
url: 'mysql+pymysql://$USER:$PASS@$MYSQL_SERVER/$DB'
table: $TABLE
Whe Gramex starts, it reports an Exception:
InternalError: (pymysql.err.InternalError) (3159, 'Connections using insecure transport are prohibited while --require_secure_transport=ON.')
This answer suggests passing a dummy ssl:
dict.
How do I pass this to Gramex's FormHandler?
Upvotes: 0
Views: 112
Reputation: 11948
There are 2 possibilities. If you don't have an SSL certificate to connect to the database, use:
otp:
url: 'mysql+pymysql://$USER:$PASS@$MYSQL_SERVER/$DB'
table: $TABLE
connect_args:
ssl:
fake_flag_to_enable_tls: true
If you have an SSL CA certificate in a PEM format, use:
otp:
url: 'mysql+pymysql://$USER:$PASS@$MYSQL_SERVER/$DB'
table: $TABLE
connect_args:
ssl_ca: /path/to/ca-certificate.pem
You may pass any other parameter to the pymysql connection object.
Upvotes: 1