LINUX.ORG.RU

wget не спрашивает пароль клиентного сертификата


0

1

Есть сайт с аутентификацией юзера по ssl. Есть юзерский сертификат в формате pkcs12. В огнелисе работает.

Надо сделат пост-запрос из консоли. Приватный ключ должен быть зашифрованым.

Делаю так:

$ openssl pkcs12 -nokeys -clcerts -in mycert.p12 -out mycert.crt
Enter Import Password:
MAC verified OK
$ openssl pkcs12 -nocerts -in mycert.p12 -out mycert.key -nodes
Enter Import Password:
MAC verified OK
$ wget --certificate=mycert.crt --private-key=mycert.key -O- https://mysite --post-data=mydata=foobar
...
200 OK
...
<html>...Welcome...</html>
...

Ключ не зашифрован, всё работает.

Делаю так:

$ openssl pkcs12 -nocerts -in mycert.p12 -out mycert.key
Enter Import Password:
MAC verified OK
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
$ wget --certificate=mycert.crt --private-key=mycert.key -O- https://mysite --post-data=mydata=foobar
...
200 OK
...
<html>...You are not authenticated...</html>
...
Ключ зашифрован, wget не спрашивает пароль от ключа, аутентификация фейлится.

Гугл говорит, что wget таки умеет работать с шифроваными ключами.

Что я делаю не так?


$ uname -a 
Linux sirius-b 3.14-2-amd64 #1 SMP Debian 3.14.13-2 (2014-07-24) x86_64 GNU/Linux
$ wget -version
wget: Invalid --execute command ‘rsion’
$ wget --version
GNU Wget 1.15 built on linux-gnu.

+digest +https +ipv6 +iri +large-file +nls +ntlm +opie +ssl/gnutls 

Wgetrc: 
    /etc/wgetrc (system)
Locale: 
    /usr/share/locale 
Compile: 
    gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc" 
    -DLOCALEDIR="/usr/share/locale" -I. -I../lib -I../lib 
    -D_FORTIFY_SOURCE=2 -I/usr/include -g -O2 -fstack-protector 
    --param=ssp-buffer-size=4 -Wformat -Werror=format-security 
    -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall 
Link: 
    gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
    -Werror=format-security -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall 
    -Wl,-z,relro -L/usr/lib -lnettle -lgnutls -lz -lidn -luuid 
    ftp-opie.o gnutls.o http-ntlm.o ../lib/libgnu.a 

Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Originally written by Hrvoje Niksic <hniksic@xemacs.org>.
Please send bug reports and questions to <bug-wget@gnu.org>.
suuaq
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.