Operating System - OpenVMS
1748150 Members
3532 Online
108758 Solutions
New Discussion юеВ

Re: more problems with curl on VMS7.3-2

 
robert70
Valued Contributor

more problems with curl on VMS7.3-2

Hi
following on from my earlier thread i now have a very perplexing problem as follows:-


I can connect to https://www.website.com/export.jsp using CURL on an Alpha via a proxy server.
Command used here:-

$ curl --verbose --insecure --proxy PROXY.UK.UK.UK:8080 --proxy-user user:pass
--output y.zip --form user=user
--form password=password --form date=20091104
--form format=xml --form report=COMPOSITES
--form version=5 --form type=ABS
https://www.website.com/export.jsp

this gives the following:-

* About to connect() to proxy proxy.uk.uk.uk port 8080 (#0)
* Trying 1111.11.11.1... connected
* Connected to proxy.uk.uk.uk (111.11.11.1) port 8080 (#0)
* Establish HTTP proxy tunnel to www.website.com:443
* Proxy auth using Basic with user 'user'
> CONNECT www.website.com:443 HTTP/1.1
> Host: www.website.com:443
> Proxy-Authorization: Basic c2FuZGlzb3I6cGFzc3dvcmQy
> User-Agent: curl/7.19.5 (ALPHA-HP-VMS) libcurl/7.19.5 OpenSSL/0.9.7e
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0*
Proxy replied OK to CONNECT request
* libcurl is now using a weak random seed!
* SSLv2, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Server hello (2):
{ [data not shown]
* SSLv3, TLS handshake, CERT (11):
{ [data not shown]
* SSLv3, TLS handshake, Server key exchange (12):
{ [data not shown]
* SSLv3, TLS handshake, Server finished (14):
{ [data not shown]
* SSLv3, TLS handshake, Client key exchange (16):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Finished (20):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
{ [data not shown]
* SSLv3, TLS handshake, Finished (20):
{ [data not shown]
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: C=GB, ST=Herts, L=St Albans, O=Markit Group Ltd, OU=sfa30052ww
w001, OU=Terms of use at www.verisign.co.uk/rpa (c)05, OU=Authenticated by VeriS
ign, OU=Member, VeriSign Trust Network, CN=www.website.com
* start date: 2008-10-23 00:00:00 GMT
* expire date: 2011-11-30 23:59:59 GMT
* common name: www.website.com (matched)
* issuer: O=VeriSign Trust Network, OU=VeriSign, Inc., OU=VeriSign Intern
ational Server CA - Class 3, OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LT
D.(c)97 VeriSign
* SSL certificate verify result: unable to get local issuer certificate (
20), continuing anyway.
> POST /export.jsp HTTP/1.1
> User-Agent: curl/7.19.5 (ALPHA-HP-VMS) libcurl/7.19.5 OpenSSL/0.9.7e
> Host: www.website.com
> Accept: */*
> Content-Length: 748
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=----------------------------d2309e
fc5ab8
>
< HTTP/1.1 100 Continue
} [data not shown]
106 748 0 0 106 748 0 579 0:00:01 0:00:01 --:--:-- 599<
HTTP/1.1 200 OK
< Date: Tue, 10 Nov 2009 15:24:35 GMT
< Server: Apache/2.2.3 (Red Hat)
< Set-Cookie: JSESSIONID=4B8BE3C725F8960B88AADB6806CD2F3C; Path=/
< Content-Disposition: attachment; filename=V5 ABS Composites1257866676089.zip
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: application/x-zip; name=V5 ABS Composites1257866676089.zip;chars
et=ISO-8859-1
<
{ [data not shown]
100 236k 0 235k 106 748 143k 455 0:00:01 0:00:01 --:--:-- 147k*
Closing connection #0
* SSLv3, TLS alert, Client hello (1):
} [data not shown]


A Y.ZIP file is downloaded successfully.

Now the address has been changed to https://sf.website.com and using the same CURL command (obviously pointing at sf.website.com rather than www.website.com) we get the following:-

* About to connect() to proxy proxy.uk.uk.uk port 8080 (#0)
* Trying 111.11.11.1... connected
* Connected to proxy.uk.uk.uk (111.11.11.1) port 8080 (#0)
* Establish HTTP proxy tunnel to sf.website.com:443
* Proxy auth using Basic with user 'user'
> CONNECT sf.website.com:443 HTTP/1.1
> Host: sf.website.com:443
> Proxy-Authorization: Basic c2FuZGlzb3I6cGFzc3dvcmQy
> User-Agent: curl/7.19.5 (ALPHA-HP-VMS) libcurl/7.19.5 OpenSSL/0.9.7e
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 407 Proxy Authentication Required
< Proxy-Authenticate: NTLM
< Proxy-Authenticate: BASIC realm="HBEU_AD"
* Authentication problem. Ignoring this.
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Proxy-Connection: close
< Set-Cookie: BCSI-CSAC1B1624=2; Path=/
< Connection: close
< Content-Length: 813
<
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0*
Received HTTP code 407 from proxy after CONNECT
* Closing connection #0

%CURL-E-RECV_ERROR, RECV error, failure receiving network data

No Y.ZIP is downloaded.
So all that has changed is that we now point to sf. rather than www. ?

Oddily my PC which is on the same network as the Alpha works for both www and sf no problem.

HELP!

6 REPLIES 6
Hoff
Honored Contributor

Re: more problems with curl on VMS7.3-2

The http 407 usually means that the target web server is happy with you and that an intervening proxy server wants you to authenticate to it; that your proxy server here tossed you off the connection.
robert70
Valued Contributor

Re: more problems with curl on VMS7.3-2

Thanks Hoff
robert70
Valued Contributor

Re: more problems with curl on VMS7.3-2

It was simply down to the Proxy Password being a mix of upper and lower case! When enclosed in double quotes
"Username:Password"
All works fine!

Steven Schweda
Honored Contributor

Re: more problems with curl on VMS7.3-2

> HELP SET PROCESS /PARSE_STYLE

> Im using traditional parse style

> [...] When enclosed in double quotes [...]

There's the easy way, and there's your way.
Hoff
Honored Contributor

Re: more problems with curl on VMS7.3-2

Unix commands and shell-scripting and C- and Unix-based foreign commands on OpenVMS can and usually will force the programmer to manage casing.

Switching to extended parsing on OpeNVMS can cause its own issues for existing applications and DCL procedures; for those Unix and shell stuff that is incorrectly coded and that currently works only because it gets down-cased.
robert70
Valued Contributor

Re: more problems with curl on VMS7.3-2

Steven, Hoff - Thanks to you both again
cheers
Robert