cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl: (52) Empty reply from server

From: Ajay <stealthu471_at_gmail.com>
Date: Mon, 21 May 2012 08:05:00 -0700

Kamil,

I realized my mistake that I thought "192.168.1.254" is the ip address of
https://www.tvg.com . I later executed a
traceroute www.tvg.com
and realized that the ip address is 208.88.35.20 .

When I executed your version of passing https as port
curl -v https://208.88.35.20

I get the following message, which is different from the message you
received.

* About to connect() to 208.88.35.20 port 443 (#0)
* Trying 208.88.35.20... connected
* Connected to 208.88.35.20 (208.88.35.20) port 443 (#0)
* Initializing NSS with certpath: /etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL: certificate subject name 'www.tvg.com' does not match target host
name '208.88.35.20'
* NSS error -12276
* Closing connection #0
curl: (51) SSL: certificate subject name 'www.tvg.com' does not match
target host name '208.88.35.20'

I also tried passing port number through the format in which Dan passed the
port argument
curl -v 208.88.35.20:443

I am getting the following message
* About to connect() to 208.88.35.20 port 443 (#0)
* Trying 208.88.35.20... connected
* Connected to 208.88.35.20 (208.88.35.20) port 443 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.0 (i386-redhat-linux-gnu) libcurl/7.21.0 NSS/
3.12.10.0 zlib/1.2.5 libidn/1.18 libssh2/1.2.4
> Host: 208.88.35.20:443
> Accept: */*
>
* Empty reply from server
* Connection #0 to host 208.88.35.20 left intact
curl: (52) Empty reply from server
* Closing connection #0

In the above, it is clearly trying the "http" connection - "GET /
HTTP/1.1", which is probably the same as the website not displaying in a
browser when http is typed. In your version of the command - "https" in the
front, it is accessing SSL. Also, based on your system error message and
mine, corroborate our(my) understanding that "SSL_ERROR_RX_RECORD_TOO_LONG"
corresponds to "does not match target host name."

Any idea how to fix this incompatibility will be helpful.

Thanks,
Ajay

On Mon, May 21, 2012 at 7:48 AM, Kamil Dudka <kdudka_at_redhat.com> wrote:

> On Monday 21 May 2012 16:21:54 Ajay wrote:
> > Kamil,
> >
> > Thanks for replying. I will upgrade to latest version of Fedora soon.
> When
> > I upgraded my Fedora version last, some new problems started showing. I
> had
> > to spend good amount of time fixing them, so the cautious approach and
> the
> > procrastination in upgrading my system's Fedora version to a latest one.
> > But, I will it so soon.
> >
> > Thanks for trying out the command. The error message you received was
> quite
> > informative. I searched for "SSL_ERROR_RX_RECORD_TOO_LONG" and found the
> > following URL,
> > http://www.lodesys.com/blog/2009/resolving.php
> > which basically says something like that such an error occurs when host
> > name and ip address have a mismatch.
> >
> > The above information gave me an idea about accessing
> > https://www.tvg.comthrough curl using ipaddress instead of domain
> > name. Therefore, first, I
> > typed
> > dig https://www.tvg.com
> >
> > obtained the ip address of tvg domain and then tried accessing it's
> server
> > through it's ip address.
> > curl -v http://www.tvg.com
> > curl -v 192.168.1.254
> >
> > I then received the normal output, without any error.
>
> www.tvg.com resolves to 208.88.35.20 on my box and a SSL connection via
> that
> IP address ends up with the exactly same error:
>
> $ curl -v https://208.88.35.20
> * About to connect() to 208.88.35.20 port 443 (#0)
> * Trying 208.88.35.20...
> * connected
> * Connected to 208.88.35.20 (208.88.35.20) port 443 (#0)
> * Initializing NSS with certpath: sql:/etc/pki/nssdb
> * CAfile: /etc/pki/tls/certs/ca-bundle.crt
> CApath: none
> * NSS error -12263 (SSL_ERROR_RX_RECORD_TOO_LONG)
> * Closing connection #0
> * SSL connect error
> curl: (35) SSL connect error
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-05-21