Curl (openssl) fails to open some https URLs with "illegal parameter" error

Bug #595415 reported by Chris May
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
curl (Ubuntu)
Incomplete
Undecided
Unassigned
openssl (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: curl

Some HTTPS urls cause curl to fail with an "illegal parameter" error. This error goes away if you manually specify "--sslv3"

e.g.

$ curl --version
curl 7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

$ curl https://www.orange.sk/
curl: (35) error:14077417:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert illegal parameter

$ curl --sslv3 https://www.orange.sk/
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="sk" lang="sk">
...etc

This is particularly problematic if using an application which uses libcurl, but does not allow setting of the --sslv3 flag, e.g. nagios's check_http utility.

This redhat bug https://bugzilla.redhat.com/show_bug.cgi?id=525496 appears to describe the same problem, and has a patch

Revision history for this message
Andreas Olsson (andol) wrote :

I assume the curl 7.19.17 in question is the curl 7.19.7-1ubuntu1 available in Ubuntu 10.04?

I can't seem to reproduce this error against orange.sk. Possibly due/thanks to a server side change on their part?

Are you experiencing this issue against any other sites?

Changed in curl (Ubuntu):
status: New → Incomplete
Revision history for this message
Chris May (chris-may) wrote :

The URL mentioned in the original Curl thread (http://curl.haxx.se/mail/curlphp-2008-10/0001.html) still fails in the same way

$ curl https://www.etisalat.com.eg
curl: (35) error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message

$ curl --sslv3 https://www.etisalat.com.eg
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
...etc.

Revision history for this message
Chris May (chris-may) wrote :

Just noticed that the failure above is very slightly different; it prints "unexpected message" rather than "illegal parameter", although it still goes away if you manually specify --sslv3.

I have servers which generate the "illegal parameter" error too, but unfortunately they're not generally accessible from the internet. If it's essential, though, I can probably make one available, or if not then I'm happy to test patches locally.

Revision history for this message
Andreas Olsson (andol) wrote :
Download full text (3.8 KiB)

Ok, given that I discovered the same behavior from wget I decided going directly to openssl.

root@natty:~# openssl s_client -connect www.etisalat.com.eg:443
CONNECTED(00000003)
1432:error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message:s23_clnt.c:602:
root@natty:~#

Looks familiar?

Explicitly asking for ssl3, we get the following response:

root@natty:~# openssl s_client -ssl3 -connect www.etisalat.com.eg:443
CONNECTED(00000003)
depth=3 /C=US/O=GTE Corporation/OU=GTE CyberTrust Solutions, Inc./CN=GTE CyberTrust Global Root
verify error:num=19:self signed certificate in certificate chain
verify return:0
---
Certificate chain
 0 s:/C=EG/L=Cairo/ST=Cairo/O=etisalat/OU=IT/CN=*.etisalat.com.eg
   i:/C=AE/O=Etisalat/OU=Etisalat eBusiness Services/CN=Comtrust Server Certification Authority
 1 s:/C=AE/O=Etisalat/OU=Etisalat eBusiness Services/CN=Comtrust Server Certification Authority
   i:/C=AE/O=Etisalat/OU=Etisalat eBusiness Services/CN=Comtrust Root Certification Authority
 2 s:/C=AE/O=Etisalat/OU=Etisalat eBusiness Services/CN=Comtrust Root Certification Authority
   i:/C=US/O=GTE Corporation/OU=GTE CyberTrust Solutions, Inc./CN=GTE CyberTrust Global Root
 3 s:/C=US/O=GTE Corporation/OU=GTE CyberTrust Solutions, Inc./CN=GTE CyberTrust Global Root
   i:/C=US/O=GTE Corporation/OU=GTE CyberTrust Solutions, Inc./CN=GTE CyberTrust Global Root
---
Server certificate
-----BEGIN CERTIFICATE-----
MIID5TCCAs2gAwIBAgICEEswDQYJKoZIhvcNAQEFBQAweDELMAkGA1UEBhMCQUUx
ETAPBgNVBAoTCEV0aXNhbGF0MSQwIgYDVQQLExtFdGlzYWxhdCBlQnVzaW5lc3Mg
U2VydmljZXMxMDAuBgNVBAMT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QI4ovHTh8D+RK+i+/g/8oE/a4
JE3e2E+Pj7FzqrDTurkq6w0tj/24YLepudo936NpAfC7RtjxPSb647+2Tdjf4Kao
z0hjMrS30cnTjQMNw+QqQmNrNp21rKM7QHCmCnYEAWn0TkGMx5enNEA=
-----END CERTIFICATE-----
subject=/C=EG/L=Cairo/ST=Cairo/O=etisalat/OU=IT/CN=*.etisalat.com.eg
issuer=/C=AE/O=Etisalat/OU=Etisalat eBusiness Services/CN=Comtrust Server Certification Authority
---
No client certificate CA names sent
---
SSL handshake has read 3996 bytes and written 301 bytes
---
New, TLSv1/SSLv3, Cipher is DES-CBC3-SHA
Server p...

Read more...

Changed in openssl (Ubuntu):
status: New → Incomplete
summary: - Curl fails to open some https URLs with "illegal parameter" error
+ Curl (openssl) fails to open some https URLs with "illegal parameter"
+ error
Revision history for this message
Ralf Hildebrandt (ralf-hildebrandt) wrote :

This happens to me as well, I compiled squid-3.2 from source with --enable-ssl, and I'm getting exactly the same message

Revision history for this message
Ralf Hildebrandt (ralf-hildebrandt) wrote :

$ curl https://www.etisalat.com.eg
curl: (35) error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message

also happens on natty

description: updated
Revision history for this message
Ralf Hildebrandt (ralf-hildebrandt) wrote :

Marking this bug incomplete without actually say WHAT is missing to make it complete is not helping!

Changed in openssl (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Stefan Kriwanek (Divan) (dev-stefankriwanek) wrote :
Download full text (5.3 KiB)

I have got another curl example for reproduction of the bug. It only fails if curl is provided with a cookies file, which I can only provide on request (want to keep it private as possible). This example did work well in Natty (no idea about Oneiric)

The line is (no, you can not remove the long data part):

/usr/bin/curl -b/home/stefan/.geocookies -c/home/stefan/.geocookies -d'__VIEWSTATE=/wEPDwUKLTIxMjA4MDI5OA8WAh4OTG9naW4uUmVkaXJlY3RlFgJmD2QWBGYPZBYEAgoPFgIeBFRleHQFYjxtZXRhIG5hbWU9IkNvcHlyaWdodCIgY29ud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hFc3Bhw7FvbB8HaGRkAg0PZBYCAgEPDxYIHwUFBWh1LUhVHwYFDVNldFRlbXBMb2NhbGUfAQUGTWFneWFyHwdoZGQCDg9kFgICAQ8PFggfBQUFcm8tUk8fBgUNU2V0VGVtcExvY2FsZR8BBQhSb23Dom7Egx8HaGRkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBR5jdGwwMCRDb250ZW50Qm9keSRjYlJlbWVtYmVyTWUGzXazrzLQi84q6aT2dompupv8rw==' -L 'https://www.geocaching.com/login/default.aspx' -v

Without an additional --sslv3 the output is

* About to connect() to www.geocaching.com port 443 (#0)
* Trying 66.150.167.189... connected
* successfully set certificate verify locations:
* CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SS...

Read more...

Revision history for this message
chrone (chrone81) wrote :

i just noted on ubuntu 12.04 server edition x64 that if i use only rc4 chiper on apache mod ssl, the curl could not fect the https://. but if i enabled higher chiper such as camelia or aes, the curl https:// command is running fine.

i don't know on which package this bug is. is it from curl, php5-curl, apache, or openssl.

Revision history for this message
Rex Tsai (chihchun) wrote :

This issue has been fixed in precise.

 ca-certificates 20111211
 coreutils 8.13-3ubuntu3.1
 debconf 1.5.42ubuntu1
 dpkg 1.16.1.2ubuntu7
 gcc-4.6-base 4.6.3-1ubuntu5
 libacl1 2.2.51-5ubuntu1
 libasn1-8-heimdal 1.6~git20120311.dfsg.1-2
 libattr1 1:2.4.46-5ubuntu1
 libbz2-1.0 1.0.6-1
 libc-bin 2.15-0ubuntu10.3
 libc6 2.15-0ubuntu10.3
 libcomerr2 1.42-1ubuntu2
 libcurl3 7.22.0-3ubuntu4
 libdb5.1 5.1.25-11build1
 libgcc1 1:4.6.3-1ubuntu5
 libgcrypt11 1.5.0-3ubuntu0.1
 libgnutls26 2.12.14-5ubuntu3.1
 libgpg-error0 1.10-2ubuntu1
 libgssapi-krb5-2 1.10+dfsg~beta1-2ubuntu0.3
 libgssapi3-heimdal 1.6~git20120311.dfsg.1-2
 libhcrypto4-heimdal 1.6~git20120311.dfsg.1-2
 libheimbase1-heimdal 1.6~git20120311.dfsg.1-2
 libheimntlm0-heimdal 1.6~git20120311.dfsg.1-2
 libhx509-5-heimdal 1.6~git20120311.dfsg.1-2
 libidn11 1.23-2
 libk5crypto3 1.10+dfsg~beta1-2ubuntu0.3
 libkeyutils1 1.5.2-2
 libkrb5-26-heimdal 1.6~git20120311.dfsg.1-2
 libkrb5-3 1.10+dfsg~beta1-2ubuntu0.3
 libkrb5support0 1.10+dfsg~beta1-2ubuntu0.3
 libldap-2.4-2 2.4.28-1.1ubuntu4.1
 liblzma5 5.1.1alpha+20110809-3
 libp11-kit0 0.12-2ubuntu1
 libroken18-heimdal 1.6~git20120311.dfsg.1-2
 librtmp0 2.4~20110711.gitc28f1bab-1
 libsasl2-2 2.1.25.dfsg1-3ubuntu0.1
 libselinux1 2.1.0-4.1ubuntu1
 libsqlite3-0 3.7.9-2ubuntu1.1
 libssl1.0.0 1.0.1-4ubuntu5.5
 libtasn1-3 2.10-1ubuntu1.1
 libwind0-heimdal 1.6~git20120311.dfsg.1-2
 multiarch-support 2.15-0ubuntu10.3
 openssl 1.0.1-4ubuntu5.5
 perl-base 5.14.2-6ubuntu2.1
 tar 1.26-4ubuntu1
 tzdata 2012e-0ubuntu0.12.04.1
 xz-utils 5.1.1alpha+20110809-3
 zlib1g 1:1.2.3.4.dfsg-3ubuntu4

Revision history for this message
Adrien Nader (adrien) wrote :

I'm going to mark this as Fix Released due to the message above even though I wasn't able to try to reproduce today (due to so many things having changed since 2012).

Changed in openssl (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.