Почему сервер не принимает SSL сертификат?

После настройки mod_ssl на сервере (apache 2.2) создался само подписанный сертификат localhost.crt и ключ localhost.key

Конфиг openssl.cnf такой
Смотреть
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#

# This definition stops the following lines choking if HOME isn't
# defined.
HOME			= .
RANDFILE		= $ENV::HOME/.rnd

# Extra OBJECT IDENTIFIER info:
#oid_file		= $ENV::HOME/.oid
oid_section		= new_oids

# To use this configuration file with the "-extfile" option of the
# "openssl x509" utility, name here the section containing the
# X.509v3 extensions to use:
# extensions		= 
# (Alternatively, use a configuration file that has only
# X.509v3 extensions in its main [= default] section.)

[ new_oids ]

# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
# Add a simple OID like this:
# testoid1=1.2.3.4
# Or use config file substitution like this:
# testoid2=${testoid1}.5.6

# Policies used by the TSA examples.
tsa_policy1 = 1.2.3.4.1
tsa_policy2 = 1.2.3.4.5.6
tsa_policy3 = 1.2.3.4.5.7

####################################################################
[ ca ]
default_ca	= CA_default		# The default ca section

####################################################################
[ CA_default ]

dir		= /etc/pki/CA		# Where everything is kept
certs		= $dir/certs		# Where the issued certs are kept
crl_dir		= $dir/crl		# Where the issued crl are kept
database	= $dir/index.txt	# database index file.
#unique_subject	= no			# Set to 'no' to allow creation of
					# several ctificates with same subject.
new_certs_dir	= $dir/newcerts		# default place for new certs.

certificate	= /etc/pki/tls/certs/localhost.crt 	# The CA certificate
serial		= $dir/serial 		# The current serial number
crlnumber	= $dir/crlnumber	# the current crl number
					# must be commented out to leave a V1 CRL
crl		= $dir/crl.pem 		# The current CRL
private_key	= /etc/pki/tls/private/localhost.key# The private key
RANDFILE	= $dir/private/.rand	# private random number file

x509_extensions	= usr_cert		# The extentions to add to the cert

# Comment out the following two lines for the "traditional"
# (and highly broken) format.
name_opt 	= ca_default		# Subject Name options
cert_opt 	= ca_default		# Certificate field options

# концовку подрезал, если необходимо могу дополнить.



При введении команд нахожусь в каталоге /CA/ (а, кстати, имеет значения где находится?)

Запрос на клиентский сертификат
# openssl req -new -newkey rsa:1024 -nodes -keyout client01.key \
        -subj /C=RU/ST=Msk/L=Msk/O=Inc/OU=Web/CN=usr/emailAddress=usr@dm.ru \
        -out client01.csr


Подписываю запрос
# openssl ca -config ../tls/openssl.cnf -in client01.csr -out client01.crt -batch


Все это дело укомплектовываю
# openssl pkcs12 -export -in client01.crt -inkey client01.key \
        -certfile localhost.crt -out client01.p12 -passout pass:q1w2e3


При создании сертификатов никаких ошибок не возникает.

Но когда захожу по https://test.ru/ просит выбрать сертификат, выбираю свой, но авторизацию сервер не принимает
google chrome
Этот сервер требует сертификат для аутентификации и не принял сертификат, отправленный браузером. Срок действия вашего сертификата, возможно, истек, или сервер не доверяет издателю. Можно повторить попытку, используя другой сертификат (при его наличии), или получить допустимый сертификат.
Код ошибки: ERR_BAD_SSL_CLIENT_AUTH_CERT


В чем может быть проблема?
С сертификатами ранее не работал, может есть какие-то стандартные подводные камни, в настройке конфигурации или еще в чем-нибудь?
  • Вопрос задан
  • 4305 просмотров
Решения вопроса 1
ifaustrue
@ifaustrue
Пишу интересное в теллеграмм канале @cooladmin
Надо бы конфиг virtual host (или корневого сайта) глянуть, а так же те места где вы ssl авторизацию прикрутили.
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
@rapidsslonline
Usually, some of servers doesn't accept self-signed certificate because they won't be trusted by servers. It would be highly recommended that go through third party certificate authority such as Symatecn, GeoTrust, Thawte and RapidSSL.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы