I've configured on my Linux server (SLES11) with IHS Webserver with WebDAV enabled. A file upload via curl
is successful using a URL like this:
$ curl --insecure --upload-file testfile.txt \
https://<URL>.com/upload/hro/ -u hro:$HRO_WEBDAV_PASSWORD
Resulting in this output:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>201 Created</title>
</head><body>
<h1>Created</h1>
<p>Resource /upload/hro/testfile.txt has been created.</p>
<hr />
<address>IBM_HTTP_Server Server at <URL> Port 443</address>
If I try this with "localhost" instead of the URL it doesn't worked. I get a SSL Error:
$ curl --insecure --upload-file testfile.txt \
https://localhost/upload/hro/ -u hro:$HRO_WEBDAV_PASSWORD
Resulting in this:
curl: (51) SSL peer certificate or SSH remote key was not OK
This is coherent because the certificate is signed for the url not for "localhost". But I have used the option --insecure
and I've intended for this through the use of this option to ignore this failure.
Questions
- What should I do to use
localhost
forcurl
? - Is there no option for this script to use the localhost URL?
netstat -anp |grep 443
to confirm. – slm♦ May 29 at 12:27curl
command with the-v
for verbose switch? – slm♦ May 30 at 12:34