当我尝试发送邮件时,出现以下错误:
gnutls_handshake:收到了意外的 TLS 数据包。
这是我的 .muttrc(myname、myaddress 和 mymail 是占位符):
# Automatically log in to this mailbox at startup
set imap_user="myname"
set imap_pass=""
set spoolfile="imaps://imap.myaddress/Inbox"
set folder="imaps://imap.myaddress/Inbox"
set record="=Sent"
set postponed="=Drafts"
# define how to send mails
set smtp_url="smtps://$imap_user:$imap_pass@smtp.myaddress:587"
# activate TLS if available on the server
set ssl_starttls=yes
# always use SSL when connecting to a server
set ssl_force_tls=yes
# wait to enter mailbox manually
set imap_passive
# Automatically poll subscribed mailboxes for new mail (new in 1.5.11)
set imap_check_subscribed …
Run Code Online (Sandbox Code Playgroud) 我们需要使用证书通过 tls 将我们的 php 脚本连接到 LDAP。LDAP 连接在没有 tls 的情况下运行良好。更多细节在这里/sf/ask/1068217671/
我们设法使用 Softerra LDAP 浏览器从 Windows 通过 tls 进行连接。它要求我们安装证书以及我们是否信任它。
我的最终结果是能够使用来自 php 的 TLS 对 LDAP 进行身份验证。我已获得 .cer 类型的证书。它来自 Windows Exchange 机器。据我所知,SLES 支持 .pem 证书。所以我的问题是...
Q1:我是否需要先从 .cer 转换为 .pem,然后才能在客户端(SLES 服务器)上安装证书,最后Q2:在服务器上安装此证书的最佳方法是什么,以便我的 php 应用程序可以访问它并完成它的工作。请注意,在 SLES 服务器上,我们需要连接到不同的 LDAP 服务器。
目前如果我们跑
ldapsearch -H ldaps://localhost:9215 -W
Run Code Online (Sandbox Code Playgroud)
我们得到
Enter LDAP Password:
ldap_sasl_interactive_bind_s: Can't contact LDAP server (-1)
additional info: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (unable to get local issuer certificate)
Run Code Online (Sandbox Code Playgroud)
我在这里找到了很多很好的信息http://www.php.net/manual/de/function.ldap-connect.php#36156尤其是这句话在我看来很重要Once you've gotten …
在本地文件中有 TLS 证书,我可以使用如下语法显示其详细信息:
openssl x509 -text -noout -in cert_filename
有没有办法在 bash 终端中以相同的格式显示远程 SMTP/POP3/HTTP 服务器的 TLS 证书?
Socat非常适合交互式测试基于行的人类可读协议,如 HTTP 或 IMAP。
例如:
$ socat -d -d READLINE,history=$HOME/s.hist openssl:host:port,crnl,cafile=some.ca
Run Code Online (Sandbox Code Playgroud)
为了更好地分析,我需要捕获这样一个交互式会话 - 即接收和发送的字节。
仅仅通过 eg 硬拷贝终端输出tux
是不够的,因为客户端/服务器部分没有被标记,像 '\t' 这样的字符会丢失/静默转换。
使用tcpdump
捕获仅对未加密的连接有帮助。
因此我的问题。
答案不一定是基于 socat。如果另一个工具更适合该用例,我想阅读它。
解决方案的奖励积分,其中
我可以使用 Unix 命令行在 Unix 管道上使用 TLS/SSL 吗?
我想要相当于
$ mkfifo /tmp/spipe
$ echo a|openssl s_server -acceptFifo /tmp/spipe &
[1] 25563
$ openssl s_client -connectFifo /tmp/spipe
a
[1] Done echo a|openssl s_server -acceptFifo /tmp/spipe
Run Code Online (Sandbox Code Playgroud)
(是的,编写一个简短的程序来做到这一点并不难,但我希望现有工具可以实现)
让我澄清一下,我不希望在此过程中的任何时候都建立 tcp 连接。我想通过 UNIX 管道使用 TLS/SSL 协议。客户端将打开一个 unix 管道,并将连接到另一个管道上的服务器“侦听”。我不想将数据从 TLS tcp 连接移动到管道。
在 Postfix 中,我已经指定了我的私钥、我的证书和我的 CA 的证书
smtpd_tls_CAfile = /etc/ssl/cacert.pem
smtpd_tls_key_file = /etc/ssl/server.key
smtpd_tls_cert_file = /etc/ssl/server.pem
Run Code Online (Sandbox Code Playgroud)
在 dovecot 中,只有指定我的密钥和我的证书的选项:
ssl_cert = </etc/ssl/server.pem
ssl_key = </etc/ssl/server.key
Run Code Online (Sandbox Code Playgroud)
如何指定我的 CA 的证书?
问题是,当我将客户端连接到端口 993 时,出现证书错误。使用openssl s_client -connect server:993
我得到这个错误:
verify return:1
verify error:num=27:certificate not trusted
verify return:1
verify error:num=21:unable to verify the first certificate
verify return:1
Run Code Online (Sandbox Code Playgroud)
当我连接到端口 465 (Postfix) 时,我没有收到此错误:
openssl s_client -connect server:465
Run Code Online (Sandbox Code Playgroud) 我在使用 cURL 连接到由 CloudFlare 托管的网站时遇到问题。当我尝试使用 HTTPS(使用curl -v https://www.xxxxxx.com
)连接到网站时,它说:
* About to connect() to www.xxxxxx.com port 443 (#0)
* Trying 2400:cb00:2048:1::681c:116e...
* Connected to www.xxxxxx.com (2400:cb00:2048:1::681c:116e) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* NSS error -12286 (SSL_ERROR_NO_CYPHER_OVERLAP)
* Cannot communicate securely with peer: no common encryption algorithm(s).
* Error in TLS handshake, trying SSLv3...
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.xxxxxx.com
> Accept: */*
>
* Connection died, …
Run Code Online (Sandbox Code Playgroud) 我饶有兴趣地从sendmail 指南中读到可以禁用 TLS。我尝试通过在中添加以下行来对内部邮件执行此操作/etc/mail/access
:
Try_TLS:my.server NO
Try_TLS:localhost6.localdomain6 NO
Try_TLS:localhost.localdomain NO
Try_TLS:localhost NO
Try_TLS:127.0.0.1 NO
Run Code Online (Sandbox Code Playgroud)
但是,它似乎不起作用,我仍然看到以下内容:
Received: from my.server (localhost6.localdomain6 [127.0.0.1])
by my.server (8.14.8/8.14.8) with ESMTP id s6H2Wanf004005
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO)
for <user@my.server>; Tue, 15 Jul 2014 10:32:36 +0000
Received: (from user@localhost)
by my.server (8.14.8/8.14.8/client) id s6H2WZfQ004004
for user; Tue, 15 Jul 2014 10:32:35 +0000
Run Code Online (Sandbox Code Playgroud)
任何想法?
我正在尝试将获取的电子邮件转发fetchmail
到另一个 SMTP 主机,该主机强制执行STARTTLS
. 我找不到在fetchmail
. 这可能吗?如果是这样,如何?