Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to connect to my PostgreSQL server on AWS using SSL from the OpenSSL s_client on XP. I can connect to a third party using this s_client. On both the server and XP, I am using openssl version 0.9.8.k.

When I try to connect to my server, I get the result:

CONNECTED(00000003) 2036:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188 :

In the Postgres log, I see the entry:

2009-10-30 13:58:08 UTC LOG: invalid length of startup packet

I'd appreciate any suggestions about where to look to get this working. Maybe there is a public AWS image I can look at on which PostgreSQL is known to work?

share|improve this question

You cannot use *s_client*. PostgreSQL does protocol negotiation before SSL is started (to figure out if it should do SSL or not, since they both run on the same port). You need to use a proper PostgreSQL client (such as psql or pgadmin, for example), not *s_client*.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.