OpenVPN не отзывается ключ revoke-full

Проблемы с установкой, настройкой и работой системных и сетевых программ.

Модераторы: GRooVE, alexco

Правила форума
Убедительная просьба юзать теги [code] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
Аватара пользователя
Cancer
Гл. Кастратор
Сообщения: 1269
Зарегистрирован: 2008-03-25 12:21:36
Откуда: г. Ростов-на-Дону
Контактная информация:

OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение Cancer » 2009-12-06 19:11:25

Нужно собственно для отзыва старого ключега.

Код: Выделить всё

#. ./vars
# ./revoke-full onotole
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/openssl.cnf
DEBUG[load_index]: unique_subject = "yes"
unable to load certificate
29115:error:0906D06C:PEM routines:PEM_read_bio:no start line:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/pem/pem_lib.c:637:Expecting: TRUSTED CERTIFICATE
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/openssl.cnf
DEBUG[load_index]: unique_subject = "yes"
unable to load certificate
29118:error:0906D06C:PEM routines:PEM_read_bio:no start line:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/pem/pem_lib.c:637:Expecting: TRUSTED CERTIFICATE
А вот создаю тестовый и все нормально!

Код: Выделить всё

# ./build-key-pkcs12 cancer2
Generating a 1024 bit RSA private key
...............++++++
......++++++
writing new private key to 'cancer2.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [RU]:
State or Province Name (full name) [Rostov]:
Locality Name (eg, city) [Rostov-on-Don]:
Organization Name (eg, company) [server]:
Organizational Unit Name (eg, section) []:server
Common Name (eg, your name or your server's hostname) []:cancer2
Email Address [postmaster@xxxx.ru]:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:cancer2
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/openssl.cnf
DEBUG[load_index]: unique_subject = "yes"
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           :PRINTABLE:'RU'
stateOrProvinceName   :PRINTABLE:'Rostov'
localityName          :PRINTABLE:'Rostov-on-Don'
organizationName      :PRINTABLE:'server'
organizationalUnitName:PRINTABLE:'server'
commonName            :PRINTABLE:'cancer2'
emailAddress          :IA5STRING:'postmaster@xxxx.ru'
Certificate is to be certified until Dec  4 16:00:12 2019 GMT (3650 days)
Sign the certificate? [y/n]:y


1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
Enter Export Password:
Verifying - Enter Export Password:
# exit

Код: Выделить всё

[xxxx] /usr/local/share/doc/openvpn/easy-rsa/>sh
# . ./vars
# ./revoke-full cancer2
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/openssl.cnf
DEBUG[load_index]: unique_subject = "yes"
Revoking Certificate 1E.
Data Base Updated
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/openssl.cnf
DEBUG[load_index]: unique_subject = "yes"
cancer2.crt: /C=RU/ST=Rostov/O=server/OU=server/CN=cancer2/emailAddress=postmaster@xxxx.ru
error 23 at 0 depth lookup:certificate revoked

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Аватара пользователя
skeletor
майор
Сообщения: 2548
Зарегистрирован: 2007-11-16 18:22:04

Re: OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение skeletor » 2009-12-07 13:05:55

Нашёл в инете, чел пишет:

Код: Выделить всё

если выводит ошибку такого типа: error on line 282 of config file '....openvpn/easy-rsa/openssl.cnf', то делаешь следующее:
vi openssl.cnf
#[ pkcs11_section ]
#engine_id = pkcs11
#dynamic_path = /usr/lib/engines/engine_pkcs11.so
#MODULE_PATH = $ENV::PKCS11_MODULE_PATH
#PIN = $ENV::PKCS11_PIN
#init = 0
т.е. комментируешь все эти строчки. И снова выполняешь ./revoke-full client1.

Аватара пользователя
Cancer
Гл. Кастратор
Сообщения: 1269
Зарегистрирован: 2008-03-25 12:21:36
Откуда: г. Ростов-на-Дону
Контактная информация:

Re: OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение Cancer » 2009-12-07 19:49:13

Неа нету секции

Код: Выделить всё

[ pkcs11_section ]
И не одной строки похожей

Аватара пользователя
skeletor
майор
Сообщения: 2548
Зарегистрирован: 2007-11-16 18:22:04

Re: OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение skeletor » 2009-12-07 20:07:06

Вот, что сказано в доке:

Revoking Certificates

Revoking a certificate means to invalidate a previously signed certificate so that it can no longer be used for authentication purposes.

Typical reasons for wanting to revoke a certificate include:

* The private key associated with the certificate is compromised or stolen.
* The user of an encrypted private key forgets the password on the key.
* You want to terminate a VPN user's access.

Example

As an example, we will revoke the client2 certificate, which we generated above in the "key generation" section of the HOWTO.

First open up a shell or command prompt window and cd to the easy-rsa directory as you did in the "key generation" section above. On Linux/BSD/Unix:

. ./vars
./revoke-full client2

On Windows:

vars
revoke-full client2

You should see output similar to this:

Using configuration from /root/openvpn/20/openvpn/tmp/easy-rsa/openssl.cnf
DEBUG[load_index]: unique_subject = "yes"
Revoking Certificate 04.
Data Base Updated
Using configuration from /root/openvpn/20/openvpn/tmp/easy-rsa/openssl.cnf
DEBUG[load_index]: unique_subject = "yes"
client2.crt: /C=KG/ST=NA/O=OpenVPN-TEST/CN=client2/emailAddress=me@myhost.mydomain
error 23 at 0 depth lookup:certificate revoked

Note the "error 23" in the last line. That is what you want to see, as it indicates that a certificate verification of the revoked certificate failed.

The revoke-full script will generate a CRL (certificate revocation list) file called crl.pem in the keys subdirectory. The file should be copied to a directory where the OpenVPN server can access it, then CRL verification should be enabled in the server configuration:

crl-verify crl.pem

Now all connecting clients will have their client certificates verified against the CRL, and any positive match will result in the connection being dropped.

Аватара пользователя
Cancer
Гл. Кастратор
Сообщения: 1269
Зарегистрирован: 2008-03-25 12:21:36
Откуда: г. Ростов-на-Дону
Контактная информация:

Re: OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение Cancer » 2009-12-07 20:09:15

Ага да читал я это =)

по твоему как я удалял, вот только почему этот ключ не отзывается хз :bn:

kuril
проходил мимо

Re: OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение kuril » 2010-02-02 13:45:33

Cancer писал(а):Ага да читал я это =)

по твоему как я удалял, вот только почему этот ключ не отзывается хз :bn:

The revoke-full script will generate a CRL (certificate revocation list) file called crl.pem in the keys subdirectory. The file should be copied to a directory where the OpenVPN server can access it, then CRL verification should be enabled in the server configuration:

crl-verify crl.pem

т.е. в конфиге опенвпн допиши опцию проверки отозванных сертификатов, только после рестарта сервера - посмотри в логе, чтобы он нашел этот crl.pem, а не обругался на него.

Аватара пользователя
Cancer
Гл. Кастратор
Сообщения: 1269
Зарегистрирован: 2008-03-25 12:21:36
Откуда: г. Ростов-на-Дону
Контактная информация:

Re: OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение Cancer » 2010-02-02 13:59:14

Да причем тут это???

Тут ключ не отзывается сам... и создать не дает мне его!

Код: Выделить всё

# . ./vars
NOTE: when you run ./clean-all, I will be doing a rm -rf on /usr/local/share/doc/openvpn/easy-rsa/keys/server
# ./build-key-pkcs12 onotole
Generating a 1024 bit RSA private key
..........++++++
......++++++
writing new private key to 'onotole.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [RU]:
State or Province Name (full name) [Rostov]:
Locality Name (eg, city) [Rostov-on-Don]:
Organization Name (eg, company) [server]:
Organizational Unit Name (eg, section) []:server
Common Name (eg, your name or your server's hostname) []:onotole
Email Address [postmaster@domain.ru]:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:onotole
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/openssl.cnf
DEBUG[load_index]: unique_subject = "yes"
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           :PRINTABLE:'RU'
stateOrProvinceName   :PRINTABLE:'Rostov'
localityName          :PRINTABLE:'Rostov-on-Don'
organizationName      :PRINTABLE:'server'
organizationalUnitName:PRINTABLE:'server'
commonName            :PRINTABLE:'onotole'
emailAddress          :IA5STRING:'postmaster@domain.ru'
Certificate is to be certified until Jan 31 11:01:17 2020 GMT (3650 days)
Sign the certificate? [y/n]:y
failed to update database
TXT_DB error number 2

Аватара пользователя
T_T
ефрейтор
Сообщения: 65
Зарегистрирован: 2011-02-21 9:56:36

Re: OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение T_T » 2013-06-13 20:50:21

Так и не победили ?
у меня такая же ситуация :

Код: Выделить всё

[root@mail /usr/local/share/doc/openvpn/easy-rsa/2.0]# ./revoke-full petrivanov
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/2.0/openssl-0.9.8.cnf
Error opening petrivanov.crt petrivanov.crt
50994:error:02001002:system library:fopen:No such file or directory:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:356:fopen('petrivanov.crt','r')
50994:error:20074002:BIO routines:FILE_CTRL:system lib:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:358:
unable to load certificate
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/2.0/openssl-0.9.8.cnf
Error opening certificate file petrivanov.crt
50997:error:02001002:system library:fopen:No such file or directory:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:356:fopen('petrivanov.crt','r')
50997:error:20074002:BIO routines:FILE_CTRL:system lib:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:358:
unable to load certificate
такое чувство как будто и не было такого сертификата, но по нему подключается =\

гость8080
проходил мимо

Re: OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение гость8080 » 2013-07-09 17:17:16

http://www.opennet.ru/openforum/vsluhfo ... /3710.html

Сообщение от http://www.guruperl.net on 08-Окт-08, 15:13

Всё на самом деле очень просто.
1. Делаешь: ./revoke-full client1
а) если выводит ошибку такого типа: error on line 282 of config file '....openvpn/easy-rsa/openssl.cnf', то делаешь следующее:
vi openssl.cnf
#[ pkcs11_section ]
#engine_id = pkcs11
#dynamic_path = /usr/lib/engines/engine_pkcs11.so
#MODULE_PATH = $ENV::PKCS11_MODULE_PATH
#PIN = $ENV::PKCS11_PIN
#init = 0
т.е. комментируешь все эти строчки. И снова выполняешь пункт 1.

2. Если такой ошибки небыло, то ты должен увидеть следующее: Revoking Certificate ...
Data Base Updated

3. Копируешь только что создавшийся файл crl.pem в папку с конфигом твоего впн сервера (server.conf), например: cp keys/crl.pem /etc/openvpn/

4. Редактируешь server.conf, и смотришь, что бы там была раскоментирована эта строчка:
crl-verify crl.pem

5. Делаешь рестарт: service openvpn restart

Всё. Теперь клиент client1 твой впн сервер использовать не сможет.
-----------------------
здесь ключевой 4-й пункт )))

Аватара пользователя
T_T
ефрейтор
Сообщения: 65
Зарегистрирован: 2011-02-21 9:56:36

Re: OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение T_T » 2013-07-10 9:00:45

Не прокатило =\

Было

Код: Выделить всё

[root@mail /usr/local/share/doc/openvpn/easy-rsa/2.0]# . ./vars
NOTE: If you run ./clean-all, I will be doing a rm -rf on /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server
[root@mail /usr/local/share/doc/openvpn/easy-rsa/2.0]# ./revoke-full user-1c
cd: can't cd to /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server
Using configuration from.cnf
Error opening CA private key /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key
2012:error:02001002:system library:fopen:No such file or directory:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:356:fopen('/usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key','r')
2012:error:20074002:BIO routines:FILE_CTRL:system lib:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:358:
unable to load CA private key
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/2.0/openssl-0.9.8.cnf
Error opening CA private key /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key
2013:error:02001002:system library:fopen:No such file or directory:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:356:fopen('/usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key','r')
2013:error:20074002:BIO routines:FILE_CTRL:systemlib:/usr/src/secure/lib/libcry                                                                                                                                                             pto/../../../crypto/openssl/crypto/bio/bss_file.c:358:
unable to load CA private key
cat: ca.crt: No such file or directory
cat: crl.pem: No such file or directory
Error loading file revoke-test.pem
usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check] [-engine e] cert1 cert2 ...
recognized usages:
        sslclient       SSL client
        sslserver       SSL server
        nssslserver     Netscape SSL server
        smimesign       S/MIME signing
        smimeencrypt    S/MIME encryption
        crlsign         CRL signing
        any             Any Purpose
        ocsphelper      OCSP helper
Подправил ee /usr/local/share/doc/openvpn/easy-rsa/2.0/openssl-0.9.8.cnf

Код: Выделить всё

#[ pkcs11_section ]
#engine_id = pkcs11
#dynamic_path = /usr/lib/engines/engine_pkcs11.so
#MODULE_PATH = $ENV::PKCS11_MODULE_PATH
#PIN = $ENV::PKCS11_PIN
#init = 0
Пробую

Код: Выделить всё

[root@mail /usr/local/share/doc/openvpn/easy-rsa/2.0]# ./revoke-full user-1c
cd: can't cd to /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/2.0/openssl-0.9.8.cnf
Error opening CA private key /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key
2035:error:02001002:system library:fopen:No such file or directory:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:356:fopen('/usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key','r')
2035:error:20074002:BIO routines:FILE_CTRL:system lib:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:358:
unable to load CA private key
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/2.0/openssl-0.9.8.cnf
Error opening CA private key /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key
2036:error:02001002:system library:fopen:No such file or directory:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:356:fopen('/usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key','r')
2036:error:20074002:BIO routines:FILE_CTRL:system lib:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:358:
unable to load CA private key
cat: ca.crt: No such file or directory
cat: crl.pem: No such file or directory
Error loading file revoke-test.pem
usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check] [-engine e] cert1 cert2 ...
recognized usages:
        sslclient       SSL client
        sslserver       SSL server
        nssslserver     Netscape SSL server
        smimesign       S/MIME signing
        smimeencrypt    S/MIME encryption
        crlsign         CRL signing
        any             Any Purpose
        ocsphelper      OCSP helper
[root@mail /usr/local/share/doc/openvpn/easy-rsa/2.0]# . ./vars
NOTE: If you run ./clean-all, I will be doing a rm -rf on /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server
[root@mail /usr/local/share/doc/openvpn/easy-rsa/2.0]# ./revoke-full user-1c
cd: can't cd to /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/2.0/openssl-0.9.8.cnf
Error opening CA private key /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key
2052:error:02001002:system library:fopen:No such file or directory:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:356:fopen('/usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key','r')
2052:error:20074002:BIO routines:FILE_CTRL:system lib:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:358:
unable to load CA private key
Using configuration from /usr/local/share/doc/openvpn/easy-rsa/2.0/openssl-0.9.8.cnf
Error opening CA private key /usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key
2053:error:02001002:system library:fopen:No such file or directory:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:356:fopen('/usr/local/share/doc/openvpn/easy-rsa/2.0/keys/server/ca.key','r')
2053:error:20074002:BIO routines:FILE_CTRL:system lib:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/bio/bss_file.c:358:
unable to load CA private key
cat: ca.crt: No such file or directory
cat: crl.pem: No such file or directory
Error loading file revoke-test.pem
usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check] [-engine e] cert1 cert2 ...
recognized usages:
        sslclient       SSL client
        sslserver       SSL server
        nssslserver     Netscape SSL server
        smimesign       S/MIME signing
        smimeencrypt    S/MIME encryption
        crlsign         CRL signing
        any             Any Purpose
        ocsphelper      OCSP helper
В итоге не удалось убрать этого польлзователя =\

elakeri
проходил мимо

OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение elakeri » 2015-07-15 16:16:05

У меня тоже была такая ситуация. Пока искал наткнулся на этот топик. Короче как я понял revoke-full заносит сначала в crl.pem тот сертификат, который надо удалить. Потом через какое-то время этот список опустошается и он удаляется из базы. Посмотреть список можно list-crl. Единственное я не понял как это можно сделать принудительно и, если не принудительно, то через какие интервалы времени это делается.

Аватара пользователя
skeletor
майор
Сообщения: 2548
Зарегистрирован: 2007-11-16 18:22:04

OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение skeletor » 2015-08-07 14:55:19

принудительно перезапустить openvpn через kill -HUP

snorlov
подполковник
Сообщения: 3927
Зарегистрирован: 2008-09-04 11:51:25
Откуда: Санкт-Петербург

OpenVPN не отзывается ключ revoke-full

Непрочитанное сообщение snorlov » 2015-08-08 12:03:13

О чем весь сыр-бор то, когда вы создаете сертификат, то он прописывается в базе, когда вы удапяете его, то в базе он помечается как просроченный, но поскольку время до которого он действует еще не настало, то формируется crl список, который вы подсовываете соответствующему проверяльщику, у меня к примеру это радиус, но при этом его перезапустить или заставить его перечитать параметры. Ошибка, которая у вас выползает, заключена в некорректности конфига openssl, если параметра нет в конфиге, это не означает, что он не нужен, он просто инициализируется по умолчанию...