AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[ssl-certificate-errors](server)

Martin Hope
Finaria
Asked: 2021-11-24 00:43:42 +0800 CST

此站点缺少有效的、受信任的证书 || Apache2 网络服务器,Windows 根 CA

  • 0

我正在一起学习证书和 HTTPS,4 天后我不知道如何设置为受信任。在我的实验室环境中。我有一个具有 CA 角色的 Windows 服务器。

以前我为我的服务器安装了 VM-Dell OpenManage。它具有用于请求的图形界面和用于 HTTPS 访问的导入证书。我成功生成了一个证书签名请求并从我的 Windows CA 服务器(https://xxxx/certsrv/)获得了一个证书,它在 2 分钟内完成。

我想我可以在 apache2 网络服务器(Ubunut20.04)上试试这个。好吧,现在我被卡住了,仍然不知道如何让它工作。

1.目前(在〜50个openssl req之后)我使用这些命令请求证书:

openssl req -new -newkey rsa:2048 -nodes -addext “subjectAltName = DNS:*.mydomain.local” -keyout serverkey.key -out serverreq.csr

2.我从浏览器https://xxxx/certsrv/打开我的 windows CA 服务器并请求证书-->高级证书请求-->粘贴 serverreq.csr 内容-->WebserverTemplate。下载证书。

3.回到linux,我的conf文件(/etc/apache2/sites-avaliable/mysite.conf):长这样。

<VirtualHost _default_:443>
        Protocols h2 http/1.1
                ServerName  mysite.local
                ServerAlias www.mysite.local
                DocumentRoot /var/www/html/mysite
                SSLEngine on
                SSLCertificateFile      /etc/ssl/certandkey/myservercert.crt
                SSLCertificateKeyFile   /etc/ssl/certandkey/myserverkey.key
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
<VirtualHost *:80>
    ServerName mysite.local
    Redirect / https://mysite.local/
</VirtualHost>

我是否需要配置#Server Certificate Chain: 和 #Certificate Authority (CA):?

阿帕奇正在运行

4. 在此之后,如果我打开它说的网页

Certificate - missing
This site is missing a valid, trusted certificate (net::ERR_CERT_COMMON_NAME_INVALID).

但是如果我打开 OpenManage 它会说

Certificate - valid and trusted
The connection to this site is using a valid, trusted server certificate issued by mydomain-DC-CA

两个证书都来自同一个 Windows CA 服务器。

5.我试图配置/etc/ssl/openssl.cnf,但我不太明白怎么做。如果我编辑一些东西,那么没有任何效果。

我的配置有什么问题,我该如何配置?有什么好的教程吗?90% 的时间谷歌只展示自签名证书和浏览器魔法。但我想用 Windows CA 配置它。

感谢帮助

对不起我的英语不好。

https apache2 ssl-certificate-errors ad-certificate-services
  • 1 个回答
  • 313 Views
Martin Hope
FlyingPenguin
Asked: 2021-07-09 16:33:44 +0800 CST

谷歌负载均衡器重定向错误

  • 1

我正在尝试设置 Google 负载均衡器,但无法正常工作。它会产生 502 或 302 错误。

想要将 www 指向非 www,将 http 指向 https。

这是我的重写规则

    SetEnvIf X-Forwarded-Proto https HTTPS=on
    <VirtualHost _default_:80>
      DocumentRoot "/opt/bitnami/apache/htdocs"
      Include "/opt/bitnami/apps/letsencrypt/conf/httpd-prefix.conf"
      <IfModule mod_proxy.c>
        ProxyPass /.well-known !
      </IfModule>
      RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
      RewriteCond %{HTTP_HOST} !^localhost
      RewriteCond %{HTTP_HOST} !^[0-9]+.[0-9]+.[0-9]+.[0-9]+(:[0-9]+)?$
      RewriteCond %{REQUEST_URI} !^/\.well-known
      RewriteRule ^(.*)$ http://%1$1 [R=permanent,L]
<VirtualHost _default_:443>

  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  RewriteCond %{HTTP_HOST} !^localhost
  RewriteCond %{HTTP_HOST} !^[0-9]+.[0-9]+.[0-9]+.[0-9]+(:[0-9]+)?$
  RewriteCond %{REQUEST_URI} !^/\.well-known
  RewriteRule ^(.*)$ https://%1$1 [R=permanent,L]

Google 负载均衡器只有 1 个后端服务。后端配置为 HTTP,前端为 HTTPS,超时时间为 60 秒。

  • 该实例可通过实例的 IP 和负载均衡器的 IP 访问
  • www 到非 www 不起作用。
  • Http 给出 404 错误。
  • https 给出 502 / 302 错误。

重写规则都错了吗?

load-balancing ssl redirect google-cloud-platform ssl-certificate-errors
  • 1 个回答
  • 585 Views
Martin Hope
Alain
Asked: 2021-07-01 04:59:56 +0800 CST

Exchange 2019 ssl 证书无效

  • 0

我已安装 Exchange 2019 用于测试目的。我已经购买了域名和证书。我安装后,状态显示:无效。谢谢你。 在此处输入图像描述

这是 certutil -verify 的结果

Issuer:
    CN=ZeroSSL RSA Domain Secure Site CA
    O=ZeroSSL
    C=AT
  Name Hash(sha1): 082e3ff9058cfe8a7c18bd13efdf1d1660707a6b
  Name Hash(md5): ab1639dd9160fab0f92496ffe91dc2aa
Subject:
    CN=mail.belxchange.com
  Name Hash(sha1): e5b331beff7e2e09aeef22bae49b7edad6ef3ec7
  Name Hash(md5): 00ff0b4da8f724bc70646e3b026e45d1
Cert Serial Number: e28ee3f7a40f789620b258aae02b60dd

dwFlags = CA_VERIFY_FLAGS_CONSOLE_TRACE (0x20000000)
dwFlags = CA_VERIFY_FLAGS_DUMP_CHAIN (0x40000000)
ChainFlags = CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT (0x40000000)
HCCE_LOCAL_MACHINE
CERT_CHAIN_POLICY_BASE
-------- CERT_CHAIN_CONTEXT --------
ChainContext.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)
ChainContext.dwRevocationFreshnessTime: 17 Hours, 19 Minutes, 5 Seconds

SimpleChain.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)
SimpleChain.dwRevocationFreshnessTime: 17 Hours, 19 Minutes, 5 Seconds

CertContext[0][0]: dwInfoStatus=102 dwErrorStatus=0
  Issuer: CN=ZeroSSL RSA Domain Secure Site CA, O=ZeroSSL, C=AT
  NotBefore: 6/28/2021 8:00 PM
  NotAfter: 9/27/2021 7:59 PM
  Subject: CN=mail.belxchange.com
  Serial: e28ee3f7a40f789620b258aae02b60dd
  SubjectAltName: DNS Name=mail.belxchange.com
  Cert: beffb40c51aa7de210779220bf6b98be69d67911
  Element.dwInfoStatus = CERT_TRUST_HAS_KEY_MATCH_ISSUER (0x2)
  Element.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)
    CRL (null):
    Issuer: CN=ZeroSSL RSA Domain Secure Site CA, O=ZeroSSL, C=AT
    ThisUpdate: 6/29/2021 4:50 PM
    NextUpdate: 7/6/2021 4:50 PM
    CRL: 2e9f37d78d9ae1a9e435760e1d9b006b55dafe3c
  Issuance[0] = 1.3.6.1.4.1.6449.1.2.2.78
  Issuance[1] = 2.23.140.1.2.1
  Application[0] = 1.3.6.1.5.5.7.3.2 Client Authentication
  Application[1] = 1.3.6.1.5.5.7.3.1 Server Authentication

CertContext[0][1]: dwInfoStatus=102 dwErrorStatus=0
  Issuer: CN=USERTrust RSA Certification Authority, O=The USERTRUST Network, L=Jersey City, S=New Jersey, C=US
  NotBefore: 1/29/2020 8:00 PM
  NotAfter: 1/29/2030 7:59 PM
  Subject: CN=ZeroSSL RSA Domain Secure Site CA, O=ZeroSSL, C=AT
  Serial: 6c55abdbd00792c79d070cd8119ed6bf
  Cert: c81a8bd1f9cf6d84c525f378ca1d3f8c30770e34
  Element.dwInfoStatus = CERT_TRUST_HAS_KEY_MATCH_ISSUER (0x2)
  Element.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)
    CRL (null):
    Issuer: CN=USERTrust RSA Certification Authority, O=The USERTRUST Network, L=Jersey City, S=New Jersey, C=US
    ThisUpdate: 6/30/2021 4:28 AM
    NextUpdate: 7/7/2021 4:28 AM
    CRL: 33d94bdc17a67be0286bea0e96cfe3b6ad7c3284
  Issuance[0] = 1.3.6.1.4.1.6449.1.2.2.78
  Issuance[1] = 2.23.140.1.2.1
  Application[0] = 1.3.6.1.5.5.7.3.2 Client Authentication
  Application[1] = 1.3.6.1.5.5.7.3.1 Server Authentication

CertContext[0][2]: dwInfoStatus=10c dwErrorStatus=0
  Issuer: CN=USERTrust RSA Certification Authority, O=The USERTRUST Network, L=Jersey City, S=New Jersey, C=US
  NotBefore: 1/31/2010 8:00 PM
  NotAfter: 1/18/2038 7:59 PM
  Subject: CN=USERTrust RSA Certification Authority, O=The USERTRUST Network, L=Jersey City, S=New Jersey, C=US
  Serial: 01fd6d30fca3ca51a81bbc640e35032d
  Cert: 2b8f1b57330dbba2d07a6c51f70ee90ddab9ad8e
  Element.dwInfoStatus = CERT_TRUST_HAS_NAME_MATCH_ISSUER (0x4)
  Element.dwInfoStatus = CERT_TRUST_IS_SELF_SIGNED (0x8)
  Element.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)
  Application[0] = 1.3.6.1.5.5.7.3.2 Client Authentication
  Application[1] = 1.3.6.1.5.5.7.3.3 Code Signing
  Application[2] = 1.3.6.1.4.1.311.10.3.4 Encrypting File System
  Application[3] = 1.3.6.1.5.5.7.3.4 Secure Email
  Application[4] = 1.3.6.1.5.5.7.3.6 IP security tunnel termination
  Application[5] = 1.3.6.1.5.5.7.3.7 IP security user
  Application[6] = 1.3.6.1.5.5.7.3.1 Server Authentication
  Application[7] = 1.3.6.1.5.5.7.3.8 Time Stamping
  EV[0] = 1.3.6.1.4.1.6449.1.2.1.5.1
  EV[1] = 2.23.140.1.3

Exclude leaf cert:
  Chain: a126b04b452a7f46b037e93b530914e84dd20f84
Full chain:
  Chain: 480ccb6aae924c7427e4e32e37bf45e8261459bf
------------------------------------
Verified Issuance Policies:
    1.3.6.1.4.1.6449.1.2.2.78
    2.23.140.1.2.1
Verified Application Policies:
    1.3.6.1.5.5.7.3.2 Client Authentication
    1.3.6.1.5.5.7.3.1 Server Authentication
Cert is an End Entity certificate
Leaf certificate revocation check passed
CertUtil: -verify command completed successfully.
PS C:\Users\Administrator>

exchange ssl ssl-certificate ssl-certificate-errors exchange-2019
  • 1 个回答
  • 230 Views
Martin Hope
peris
Asked: 2020-10-03 11:25:03 +0800 CST

SSL 错误:找不到从叶证书到任何根的路径。可能缺少中间证书

  • 1

我已经使用 postfix、postfix-saslauth、courier(mysqlauthd、imap、pop)以及 SPF、DKIM 和 DMARC 等一些良好实践设置了个人邮件服务器。

这种设置在过去 10 年中一直运行良好,今天,我第一次尝试通过需要有效 POP3 服务的 GMail 添加其中一个帐户的访问权限。我可以通过端口 110 上的 POP3 服务(无安全性和/或加密)成功添加帐户。

当我尝试将 GMail 配置为通过 995 端口上的 POP3 服务访问帐户时出现问题,使用安全性。这样做时,我从 GMAIL 收到以下错误:

SSL error: No path found from the leaf certificate to any root. Maybe an intermediate certificate is missing

我已经下载了 Mozilla Thunderbird,我可以通过 POP3 服务在端口 995 上毫无问题地下载电子邮件,所以我的问题是:有谁知道如何用 GMail 解决这个问题?

以下是我的 courier-pop3d-ssl 配置:

SSLPORT=995
SSLADDRESS=0
SSLPIDFILE=/run/courier/pop3d-ssl.pid
SSLLOGGEROPTS="-name=pop3d-ssl"
POP3DSSLSTART=YES
POP3_STARTTLS=YES
POP3_TLS_REQUIRED=0
COURIERTLS=/usr/bin/couriertls
TLS_STARTTLS_PROTOCOL="$TLS_PROTOCOL"
TLS_CIPHER_LIST="TLSv1:HIGH:!LOW:!MEDIUM:!EXP:!NULL:!aNULL@STRENGTH"
TLS_STARTTLS_PROTOCOL="$TLS_PROTOCOL"
TLS_CERTFILE=/etc/courier/certificates/certificate.pem
TLS_PRIVATE_KEYFILE=/etc/courier/certificates/tls_private_keyfile.pem
TLS_DHPARAMS=/etc/courier/certificates/dhparams.pem
TLS_TRUSTCERTS=/etc/ssl/certs/ca-certificates.crt
TLS_VERIFYPEER=NONE
TLS_CACHEFILE=/var/lib/courier/couriersslimapcache
TLS_CACHESIZE=524288
MAILDIRPATH=Maildir

这是一些 SSL 证书信息:

## Letsencrypt CRT + Key cert files
cat /etc/letsencrypt/live/mydomain.com/cert.pem /etc/letsencrypt/live/mydomain.com/privkey.pem >> /etc/courier/certificates/letsencrypt-mydomain_com_crt_key.pem

ls -la /etc/courier/certificates/certificate.pem
lrwxrwxrwx 1 root courier 60 Oct  2 20:24 /etc/courier/certificates/certificate.pem -> /etc/courier/certificates/letsencrypt-mydomain_com_key.pem

ls -la /etc/courier/certificates/tls_private_keyfile.pem
lrwxrwxrwx 1 root courier 47 Oct  1 17:45 /etc/courier/certificates/tls_private_keyfile.pem -> /etc/letsencrypt/live/mydomain.com/privkey.pem

我的 SSL 证书是通过 Letsencrypt 生成的:

ls -la /etc/letsencrypt/live/mydomain.com/
total 12
drwxr-xr-x 2 root root 4096 Oct  2 14:35 .
drwx------ 8 root root 4096 Oct  2 14:35 ..
lrwxrwxrwx 1 root root   37 Oct  2 14:35 cert.pem -> ../../archive/mydomain.com/cert1.pem
lrwxrwxrwx 1 root root   38 Oct  2 14:35 chain.pem -> ../../archive/mydomain.com/chain1.pem
lrwxrwxrwx 1 root root   42 Oct  2 14:35 fullchain.pem -> ../../archive/mydomain.com/fullchain1.pem
lrwxrwxrwx 1 root root   40 Oct  2 14:35 privkey.pem -> ../../archive/mydomain.com/privkey1.pem
-rw-r--r-- 1 root root  692 Oct  2 14:35 README

这是我在/var/log/mail.logGMail 尝试通过端口 995 上的 POP3 服务连接时看到的错误:

Oct  2 21:12:15 we pop3d-ssl: Connection, ip=[::ffff:74.120.14.35]
Oct  2 21:12:16 we pop3d-ssl: ip=[::ffff:74.120.14.35], Unexpected SSL connection shutdown.
Oct  2 21:12:16 we pop3d-ssl: Disconnected, ip=[::ffff:74.120.14.35]

我应该在某处连接中间体和叶(服务器)证书吗?如何?按什么顺序?

先谢谢了

解决方案:

根据 courier-mta.org,生成的 TLS_CERTFILE 包括证书和私钥。文件名不能是世界可读的,并且必须在没有密码的情况下可以访问,即它不能被加密。

所以要解决这个问题,我必须按照这个严格的顺序连接 Letsencrypt CRT + CHAIN + KEY:

cat /etc/letsencrypt/live/mydomain.com/cert.pem /etc/letsencrypt/live/mydomain.com/chain.pem /etc/letsencrypt/live/mydomain.com/privkey.pem >> /etc/courier/certificates/certificate.pem.mydomain.com
ssl pop3 courier openssl ssl-certificate-errors
  • 1 个回答
  • 1686 Views
Martin Hope
danone
Asked: 2020-09-05 19:55:56 +0800 CST

尽管有 Openssl 1.1.1g,但启用 Nginx TLSv1.3 错误

  • 0

我有 Nginx 1.18.0 和 OpenSSL 启用 v1.1.1g。我知道在此版本之前无法启用 TLSv1.3,但即使使用此版本也是不可能的。如果我检查 ssl checkers 网站,它的启用 v1.2 完全没有任何错误,但不是 v1.3

任何想法可能是什么原因造成的?

nginx 配置

server {
    listen  443 ssl default_server;

        server_name www.website.com;

    #### REAL SSL STARTS ####
    ssl_certificate /etc/nginx/ssl/ssl-bundle.crt;
    ssl_certificate_key /etc/nginx/ssl/STAR_website_com.pem;
    ssl_prefer_server_ciphers on;
    ssl_ciphers 'TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
    proxy_ssl_protocols TLSv1.2 TLSv1.3;
    ### REAL SSL ENDS    ####
#   proxy_cookie_path / "/; HTTPOnly; Secure";
#

   
    access_log /var/log/nginx/website443.access.log;
        #access_log /var/log/nginx/domains/website.com.au.bytes bytes;
        error_log /var/log/nginx/domains/website443.com.error.log;

        #access_log /var/log/nginx/website.com.au.access.log;
        #error_log /var/log/nginx/website.com.au.error.log;
        #php-fpm log  /usr/log/www.access.log

Nginx -V

[root@test2-au ssl]# nginx -V
nginx version: nginx/1.18.0
custom build maintained on github.com/karljohns0n/nginx-more
built by gcc 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)
built with **OpenSSL 1.1.1g**  21 Apr 2020
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/cache/client_body --http-proxy-temp-path=/var/lib/nginx/cache/proxy --http-fastcgi-temp-path=/var/lib/nginx/cache/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/cache/uwsgi --http-scgi-temp-path=/var/lib/nginx/cache/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --user=nginx --group=nginx --with-compat --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_image_filter_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_geoip_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-threads --with-stream --with-stream_ssl_module --with-stream_realip_module --with-http_slice_module --with-stream_ssl_preread_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DTCP_FASTOPEN=23' --with-openssl=modules/openssl-1.1.1g --with-http_v2_hpack_enc --add-dynamic-module=modules/ngx_modsecurity-1.0.1 --add-module=modules/ngx_headers_more-0.33 --add-module=modules/ngx_cache_purge-2.3 --add-module=modules/ngx_module_vts-0.1.18 --add-module=modules/ngx_pagespeed-1.13.35.2-stable --add-module=modules/ngx_brotli-snap20200506 --add-module=modules/ngx_http_geoip2_module-3.3 --add-module=modules/ngx_echo-0.61

打开ssl版本

[root@test2-au ssl]# openssl version
OpenSSL 1.1.1c FIPS  28 May 2019
ssl nginx ssl-certificate openssl ssl-certificate-errors
  • 1 个回答
  • 299 Views
Martin Hope
ananetworking
Asked: 2020-04-12 11:58:17 +0800 CST

当服务器将带有自签名证书的整个证书链发送给客户端时,打开ssl“证书链中的自签名证书”

  • 0

我有以下证书链:

自签名证书 --> 中间证书 --> 客户端证书、服务器证书。我有 ssl 通信应用程序并验证对等设置。我尝试用openssl s_client命令测试这个链,我得到了Verify return code: 19 (self signed certificate in certificate chain). 服务器在握手中发送整个链。

我尝试使用包含自签名和中间证书的 Bundle.pem 以及 Self-signed.pem 对此进行测试,但结果是相同的。

openssl s_client -msg -connect localhost:1500 -CAfile Self-signed.pem/Bundle.pem -cert Client.crt -key Client.key

然后我颁发了另一个中间证书,并从那个证书颁发了新的服务器证书

openssl s_client -msg -connect localhost:1500 -CAfile Bundle2.pem -cert Client.crt -key Client.key

Bundle2.pem 包含第二个中间证书和自签名证书,这工作正常。此外,服务器现在不发送整个证书链,这是应用程序的设计方式。

有人可以解释为什么这是一个问题,如果服务器和客户端具有相同的中间证书,为什么我无法成功验证?

ssl-certificate openssl ssl-certificate-errors self-signed-certificate
  • 1 个回答
  • 4071 Views
Martin Hope
feroze
Asked: 2018-06-10 09:10:24 +0800 CST

ERR_SSL_VERSION_OR_CIPHER_MISMATCH 在 Tomcat 中带有签名证书

  • 2

我有一个需要签名证书的 tomcat 服务器。我使用生成了一个密钥

密钥工具-genkey ....

然后生成一个 CSR 并将其发送给我的公司管理员。

他们给了我一个带有签名证书和证书链的 CER 文件。

我使用 keytool 在密钥库中安装了根证书、中间证书和签名证书。

但是当我在服务器中使用证书并与浏览器连接时,我在 chrome 中收到 ERR_SSL_VERSION_OR_CIPHER_MISMATCH 错误。

这是我使用 openssl 调试时得到的。

$ openssl s_client -connect localhost:18443 -debug -tls1 -msg

CONNECTED(00000003) 写入 0x7fecbbc1b4d0 [0x7fecbc019000] (100 字节 => 100 (0x64)) 0000 - 16 03 01 00 5f 01 00 00-5b 03 01 5b 1c 08 e9 8a ...._...[.. [.... 0010 - 69 73 dd 18 9f 58 98 08-b3 23 dd 76 89 3c b8 7b 是...X...#.v.<.{ 0020 - 3e aa ea 61 d8 88 0f eb- af 52 45 00 00 2e 00 39 >..a.......RE....9 0030 - 00 38 00 35 00 16 00 13-00 0a 00 33 00 32 00 2f .8.5...... .3.2./ 0040 - 00 9a 00 99 00 96 00 05-00 04 00 15 00 12 00 09 ...... 0050 - 00 14 00 11 00 08 00 06- 00 03 00 ff 01 00 00 04 ...... 0060 - 00 23
.# 0064 -

TLS 1.0 握手 [长度 005f],ClientHello 01 00 00 5b 03 01 5b 1c 08 e9 8a 69 73 dd 18 9f 58 98 08 b3 23 dd 76 89 3c b8 7b 3e aa ea 61 d8 88 0f eb 0 af 52 45 0e 00 39 00 38 00 35 00 16 00 13 00 0A 00 33 00 32 00 32 00 2F 00 9A 00 99 00 96 00 96 00 05 00 04 00 04 00 15 15 00 12 00 09 00 09 00 14 00 14 00 11 00 08 08 00 08 00 06 00 06 00 06 00 06 00 03 00 03 00 ff 01 00 ff 01 00 00 00 00 04444 00 04 00 04 0004 0004 0004 0004 0004 0004 0004 0004 00 0004 0004 0004 00 23 00 00 从 0x7fecbbc1b4d0 [0x7fecbc014600] 读取(5 字节 => 5 (0x5))0000 - 15 03 01 00 02 ..... 从 0x7fecbbc1b4d0 [0x7fecbc014605] 读取(2 字节 => 2 (0x2))0000 - 02 28
.( <<< TLS 1.0 Alert [length 0002], fatal handshake_failure 02 28 24316:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/ OpenSSL098-64.50.7/src/ssl/s3_pkt.c:1145:SSL 警报号 40 24316:error:1409E0E5:SSL 例程:SSL3_WRITE_BYTES:ssl 握手失败:/BuildRoot/Library/Caches/com.apple.xbs/Sources/ OpenSSL098/OpenSSL098-64.50.7/src/ssl/s3_pkt.c:566:

任何想法我做错了什么?

我已经尝试了各种方式,来自 google 和 stackoverflow。

ssl-certificate-errors
  • 2 个回答
  • 9087 Views
Martin Hope
Darren
Asked: 2017-03-10 08:47:02 +0800 CST

带有签名证书的 SSL_ERROR_NO_CYPHER_OVERLAP 错误

  • 5

我的公司向默认使用 http 的客户提供了一个基于 Tomcat/MySQL 的应用程序。应客户的要求,我通过创建自签名证书启用它以使用 https。使用自签名证书时,这会受到预期的浏览器错误的影响。

在进行渗透测试后,他们决定我们需要禁用一些不推荐使用的 ssl 协议和密码,所以我修改了我的 tomcat server.xml 中的 ssl 连接器,如下所示:

    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
    maxThreads="150" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" sslEnabledProtocols="TLSv1.2,TLSv1.1" ciphers="TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_RC4_128_SHA,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_WITH_AES_128_GCM_SHA256"
    keystoreFile="/path/to/keystore/file"
    keystorePass="password" />

这满足了渗透测试,并且该应用程序继续在所有三种主要浏览器(Chrome、Firefox 和 IE)中运行。然而,渗透测试也表明我们最好不要使用自签名证书,因此,按照这些 指南,我创建了一个 CSR 并让客户创建一个签名到他们内部域的证书(服务器可以通过几个不同的 URL,因此需要使用 SAN 创建 CSR)。

我将证书添加到新的密钥库并适当地修改了 server.xml 文件中的路径。现在,当我尝试连接时,我收到以下错误(这是来自 Firefox,但所有浏览器都会产生类似的错误):

安全连接失败

连接到 172.31.1.36:8443 时出错。无法与对等方安全通信:没有通用加密算法。错误代码:SSL_ERROR_NO_CYPHER_OVERLAP

您尝试查看的页面无法显示,因为无法验证接收到的数据的真实性。请联系网站所有者以告知他们此问题。

我的理解是证书不控制应该使用什么密码或协议,所以我不明白为什么会发生这种情况。这是我在生成 CSR 时犯的错误,还是客户在生成证书时犯的错误?

-编辑-

我似乎到处都遇到错误。如果我尝试将密钥导入密钥库,我会得到以下信息:

cat <keyfile> | openssl  pkcs12 -export -out <keystore>.p12
Enter pass phrase:
unable to load certificates

或这个:

keytool -importkeystore -srckeystore <keyfile> -srcstoretype pkcs12 -destkeystore <keystore>.jks
Enter destination keystore password:
Re-enter new password:
Enter source keystore password:
keytool error: java.io.IOException: toDerInputStream rejects tag type 45

我让客户向我发送证书链,当我尝试导入时,我收到此错误:

keytool -import -trustcacerts -alias tomcat -file <certchain>.p7b -keystore <keystorefile>.jks
Enter keystore password:
keytool error: java.lang.Exception: Input not an X.509 certificate

我找到了一些关于如何将 pkcs 文件转换为 x.509 的解决方案,但后来我遇到了其他错误,所以我现在完全陷入困境。

tomcat ssl-certificate ssl-certificate-errors
  • 2 个回答
  • 13177 Views
Martin Hope
LeonanCarvalho
Asked: 2017-03-08 12:57:58 +0800 CST

lighttpd 上的错误“SSL3_GET_CLIENT_CERTIFICATE:peer 未返回证书”

  • 1

我正在使用有效的证书,但我无法获得客户端证书。lighttpd 服务失败并出现错误:

(connections-glue.c.200) SSL: 1 error:140890C7:SSL routines:SSL3_GET_CLIENT_CERTIFICATE:peer did not return a certificate

我的配置是这样的:

$SERVER["socket"] == ":443" {
            protocol     = "https://"
            ssl.engine   = "enable"
            ssl.disable-client-renegotiation = "enable"



            #server.name = "mywebsite.com"
            ssl.pemfile               = "/etc/lighttpd/ssl/mywebsite.com.pem"
            ssl.ca-file               = "/etc/lighttpd/ssl/mywebsite.com.csr"


            ssl.ec-curve              = "secp384r1"
            ssl.use-sslv2 = "disable"
            ssl.use-sslv3 = "disable"
            ssl.honor-cipher-order    = "enable"
            ssl.cipher-list           = "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS"

            # HSTS(15768000 seconds = 6 months)
            #setenv.add-response-header  = (
            #   "Strict-Transport-Security" => "max-age=15768000;"
            #)

            #ask for client cert
            ssl.verifyclient.exportcert = "enable" 
            ssl.verifyclient.activate   = "enable" 
            ssl.verifyclient.username   = "SSL_CLIENT_S_DN_CN" 
            ssl.verifyclient.enforce    = "enable" 
            ssl.verifyclient.depth      = 3
        }
    }
ssl lighttpd ssl-certificate ssl-certificate-errors
  • 1 个回答
  • 28059 Views
Martin Hope
Maciej Dobrowolski
Asked: 2017-03-04 03:59:14 +0800 CST

每个虚拟主机的 nginx ssl 配置

  • 4

我正在将配置从单个主机切换到 nginx 服务器上的多个虚拟主机。在我进行更改之前,ssl 工作正常,但是在添加了几个虚拟主机之后,每个虚拟主机都有唯一的域名和 - 因此 - 不同的证书,ssl 不想工作。

我原来的配置是:

# fragment of nginx.conf file
http {
    # ...
    ssl_certificate_key /path/to/privkey.pem;
    ssl_certificate     /path/to/fullchain.pem;
    ssl_dhparam         /path/to/dhparam;
    # ...
}

因此,这是 nginx 服务器的单个证书。

添加多个虚拟主机后,我希望他们为其域提供自己的正确证书。所以我从主nginx.conf文件中删除了所有与 ssl 相关的参数,并将它们添加到虚拟主机文件中,如下所示:

# fragment of sites-enabled/my.server.com file
server {
   listen 443 ssl;
   root "/var/www/my.server.com/";
   server_name my.server.com www.my.server.com;
   location / {
       try_files $uri $uri/ /index.html;

   }
   ssl_certificate_key /path/to/my/server/com/privkey.pem;
   ssl_certificate     /path/to/my/server/com/fullchain.pem;
   ssl_dhparam         /path/to/my/server/com/dhparam;
}

重新加载 nginx 后,我无法连接到这些虚拟主机:

# curl https://my.server.com 
curl: (35) gnutls_handshake() failed: The TLS connection was non-properly terminated.

# openssl s_client -connect my.server.com:443
CONNECTED(00000003) 140524682454680:error:140790E5:SSL routines:ssl23_write:ssl handshake failure:s23_lib.c:177:
--- no peer certificate available
--- No client certificate CA names sent
--- SSL handshake has read 0 bytes and written 305 bytes
--- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : 0000
    Session-ID: 
    Session-ID-ctx: 
    Master-Key: 
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1488541876
    Timeout   : 300 (sec)
    Verify return code: 0 (ok)
---

对我来说,看起来 nginx 确实无法找到/读取证书文件,但事实并非如此,因为路径与没有虚拟主机的配置完全相同。

看了之后/var/logs/nginx/error.log我也发现了这一行:

*39 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking

我确信这是我所缺少的非常小的和愚蠢的东西。谁能看到我做错了什么?

ssl nginx ssl-certificate ssl-certificate-errors
  • 1 个回答
  • 10893 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve