cURL / Mailing Lists / curl-users / Single Mail

curl-users

Segmentation fault in ftps through proxy (CONNECT)

From: robert <robertgc_at_gmail.com>
Date: Tue, 12 Sep 2006 20:27:43 +0200

Hello curl's :)

I'm new in the curl world, but I have a problem with it.

I like use curl to connect a ftps server through a proxy (CONNECT), but
I receive a "Segmentation fault" error.

The error is located in file lib/ssluse.c in the line:
  1716: int rc = SSL_write(conn->ssl[sockindex].handle, mem, (int)len);

At the moment of the error the mem variable contains a pointer to string
that contains:

  CONNECT yyy.yyy.yyy.yyy:50004 HTTP/1.0
  Host: yyy.yyy.yyy.yyyyyy.yyy.yyy.yyy:50001
  User-Agent: curl/7.15.5 (i686-pc-linux-gnu) libcurl/7.15.5
OpenSSL/0.9.7a zlib/1.1.4
  Proxy-Connection: Keep-Alive

I think SSL_write shouldn't write this, because one is for send data by
the tunnel, not for establish it.

I get the error using curl/7.15.5 in debian testing, Redhat ES 3 and
Fedora core.

Any suggestions?

Greetings
Robert Gonzalez

PD: Sorry, but my english is very poor.

-------------------------------------------------------------------------------
$ curl -v --user user:pass --proxy xxx.xxx.xxx.xxx:3128 --proxytunnel
--insecure --ftp-skip-pasv-ip ftps://yyy.yyy.yyy.yyy:990

* About to connect() to proxy xxx.xxx.xxx.xxx port 3128
* Trying xxx.xxx.xxx.xxx... connected
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 3128
* Establish HTTP proxy tunnel to yyy.yyy.yyy.yyy:990
* Server auth using Basic with user 'user'
> CONNECT yyy.yyy.yyy.yyy:990 HTTP/1.0
> Host: yyy.yyy.yyy.yyy:990
> User-Agent: curl/7.15.5 (i486-pc-linux-gnu) libcurl/7.15.5
OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Proxy-Connection: Keep-Alive
>
< HTTP/1.0 200 Connection established
<
* Proxy replied OK to CONNECT request
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* SSLv2, Client hello (1):
SSLv3, TLS handshake, Server hello (2):
SSLv3, TLS handshake, CERT (11):
SSLv3, TLS handshake, Server finished (14):
SSLv3, TLS handshake, Client key exchange (16):
SSLv3, TLS change cipher, Client hello (1):
SSLv3, TLS handshake, Finished (20):
SSLv3, TLS change cipher, Client hello (1):
SSLv3, TLS handshake, Finished (20):
SSL connection using RC4-SHA
* Server certificate:
* subject: /CN=blablabla
* start date: 2006-07-28 10:34:50 GMT
* expire date: 2016-07-25 10:34:50 GMT
* common name: blablabla
* issuer: /CN=blablabla
* SSL certificate verify result: self signed certificate (18),
continuing anyway.
< 220 Serv-U FTP Server v6.3 for WinSock ready...
> USER user
< 331 User name okay, need password.
> PASS pass
< 230 User logged in, proceed.
> PBSZ 0
< 200 PBSZ command OK. Protection buffer size set to 0.
> PWD
< 257 "/" is current directory.
* Entry path is '/'
> EPSV
* Connect data stream passively
< 500 'EPSV': command not understood.
* disabling EPSV usage
> PASV
< 227 Entering Passive Mode (192,168,1,14,195,81)
* Skips 192.168.1.14 for data connection, uses xxx.xxx.xxx.xxx instead
* Trying xxx.xxx.xxx.xxx... connected
* Connecting to yyy.yyy.yyy.yyy (xxx.xxx.xxx.xxx) port 3128
* Establish HTTP proxy tunnel to yyy.yyy.yyy.yyy:50001
* Server auth using Basic with user 'user'
Segmentation fault
Received on 2006-09-12