Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 just upgraded to Debian Wheezy from Lenny (long story) and a few of my Perl packages didn't make the upgrade for some reason, among them Crypt::SSLeay (libcrypt-ssleay-perl).

I was unable to connect to my credit card payment gateway using LWP until I installed libcrypt-ssleay-perl, and now it "works", but it takes 15-20 seconds to make the SSL connection due to the very unhelpful error message "error in unknown state":

SSL_connect:before/connect initialization
SSL_connect:unknown state
(waiting 15-20 seconds...) #this comment is from waldo22
SSL_connect:error in unknown state
SSL_connect:before/connect initialization
SSL_connect:SSLv3 write client hello A
SSL_connect:SSLv3 read server hello A
SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server done A
SSL_connect:SSLv3 write client key exchange A
SSL_connect:SSLv3 write change cipher spec A
SSL_connect:SSLv3 write finished A
SSL_connect:SSLv3 flush data
SSL_connect:SSLv3 read finished A

I have a feeling this has something to do with LWP changing the default behavior for certificate authorities and server certificiate verification:
and possibly:

My Perl module is using Crypt::SSLeay via LWP::useragent.

Obviously 15-20 seconds is way too long to wait to make an SSL connection, but without a more helpful error message, I don't know what to do.

Does anyone have any suggestions on how to better debug this or to get more verbose output?

Thanks a bunch,


share|improve this question
up vote 1 down vote accepted

Wow, this one was a doozy.

There appears to be a problem with OpenSSL 1.0.1 where attempting to auto-negotiate with TLS1.1 (or 1.2???) with some servers (edit: BigIP servers running firmware < 10.2.4) causes those servers to drop the connection and reject the request. See:

I'm trying to connect to Paypal's "Payflow Pro" credit card gateway, and Paypal was one of the main culprits on the list, originally.

According to the bug ticket, they say it is "fixed" for Paypal in 1.0.1b, but I'm running 1.0.1c-3 and still experience the problem. I don't know if that means it's fixed for but not, or what.

WORKAROUND: Setting $ENV{HTTPS_VERSION} = 3 to force SSL3 seems to fix the problem, at least for Crypt::SSLeay.

Presumably this works because it does not attempt to negotiate TLS1.1, and just uses SSL3.

Testing with openssl s_client, it works with the options -ssl3, -tls1, and -no_tls1, so it must be a negotiation problem, in my opinion.

Anyway, that's a workaround, at least.

The actual problem is caused by a bug in the firmware of F5 BigIP load balancers with firmware less than 10.2.4. This causes TLS 1.1 or 1.2 connections to not respond properly to long ClientHello requests, and thus hang.

The real fix is to update the firmware on the BigIP load balancer to >= 10.2.4.

Of course Paypal/Payflow blamed OpenSSL for this...

share|improve this answer
You can accept your own answer. This tells other people that it was correct and helped. – simbabque Oct 10 '12 at 8:43
Thanks, accepted. I didn't know if that was kosher. – waldo22 Aug 25 '13 at 1:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .