Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RDS PostgreSQL: General error: 7 SSL error: invalid key length

Sometimes I catch an error from RDS PostgreSQL.

SQLSTATE[HY000]: General error: 7 SSL error: invalid key length

Usually it works fine, but sometimes the error.

What could it be? Any ideas?

  • Engine: PostgreSQL 9.4.1
  • Certificate Authority: rds-ca-2015 (Mar 5, 2020)
  • Instance Class: db.m3.medium
  • Storage Type: General Purpose (SSD)
  • IOPS: disabled
  • Storage: 100 GB
  • Encryption Enabled: No
  • DB Instance Status: available
  • Multi AZ: No

Updated 2016-01-18

A SQL request does not matter, I catch the error with different requests, usually primitive. And I don't see any relationship with the SQL request.

I noticed, that it happens when SQL requests have a delay:

  • <- Request from PayPal Webhook Event
  • -> SQL requests (everything fine)
  • -> Request to PayPal REST API for validation (everything fine)
  • -> SQL requests (catch the error)

I cannot understand, it's only for AWS / RDS or someone catch it in other cases?

Updated 2016-01-27

From error/postgresql.log

LOG: could not receive data from client: Connection reset by peer

When I'm trying execute a query again I'm getting another error:

SQLSTATE[HY000]: General error: 7 no connection to the server

Reconnecting does not help, I have the same error "no connection to the server"


The script made 50 attempts during the day and in the end the script has worked without the error.

Seems the error related with network or connecting (PDO connecting, PHP-FPM, PHP 5.6, SSL)

like image 836
Tigrov Avatar asked Oct 19 '22 04:10

Tigrov


1 Answers

Same issue here with Paypal, I turned off the sslmode in the PostgreSQL connection pool (internal network)

sslmode=disable

dsn = 'pgsql:host=host.com;port=5432;dbname=postgres;sslmode=disable'
like image 129
Gergo Bacskai Avatar answered Oct 21 '22 22:10

Gergo Bacskai