pepoとネットワークを語ろう

40年前からこれまでとこれからのネットワークを語る

wgetで認証付のhttpsサイトをgetやー!

2011-03-31 01:01:13 | Linux

さて、wgetで認証付のhttpsサイトをgetしてみるけど、どうもうまくいかん

ずいぶん苦労したが分ってみると大した事は無いのだが
httpsをhttpとやるとこんなエラーになる
ユーザー名:docodemo
パスワード:pepolinux

[root@~]# wget --secure-protocol=auto --no-check-certificate \
http://docodemo:pepolinux@epicon.pepolinux.local:8443/index.html

--2011-03-31 01:00:57--  http://docodemo:*password*@epicon.pepolinux.local:8443/index.html
Resolving epicon.pepolinux.local... 192.168.1.2
Connecting to epicon.pepolinux.local|192.168.1.2|:8443... connected.
HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
Length: unspecified
Saving to: `index.html'

    [ <=>                                   ] 575         --.-K/s   in 0s

2011-03-31 01:00:57 (23.3 MB/s) - `index.html' saved [575]

このindex.htmlをブラウザで表示させるとこんな分けわからんメッセージが書かれとる
と言ってもHint項目を見るとなるへそ、そおなのー

Bad Request

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Hint: https://epicon.pepolinux.local:8443/

 


Apache/2.2.3 (CentOS) Server at epicon.pepolinux.local Port 8443

なわけで、WARNINGが出るもご愛嬌、下記コマンドで認証付のサイトもOKよん

[root@~]# wget --secure-protocol=auto --no-check-certificate \
https://docodemo:pepolinux@epicon.pepolinux.local:8443/index.html
--2011-03-31 00:58:11--  https://docodemo:*password*@epicon.pepolinux.local:8443/index.html
Resolving epicon.pepolinux.local... 192.168.1.2
Connecting to epicon.pepolinux.local|192.168.1.2|:8443... connected.
WARNING: cannot verify epicon.pepolinux.local's certificate, issued by `/C=JP/ST=Osaka/L=Tanimachi/O=PepoLinux/OU=IT/CN=epicon.pepolinux.local/emailAddress=root@pepolinux.local':
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 401 Authorization Required
Connecting to epicon.pepolinux.local|192.168.1.2|:8443... connected.
WARNING: cannot verify epicon.pepolinux.local's certificate, issued by `/C=JP/ST=Osaka/L=Tanimachi/O=PepoLinux/OU=IT/CN=epicon.pepolinux.local/emailAddress=root@pepolinux.local':
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html'

    [ <=>                                   ] 3,206       --.-K/s   in 0.01s

2011-03-31 00:58:11 (313 KB/s) - `index.html' saved [3206]

pepo