如何从 OpenSSL 保存 LDAP SSL 证书 [英] How to save the LDAP SSL Certificate from OpenSSL

查看:20
本文介绍了如何从 OpenSSL 保存 LDAP SSL 证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要我的 LDAP 服务器的 SSL 证书,它是 Novell eDirectory.我已经使用 openssl 连接到 ldap 来查看证书.

I wanted the SSL Certificate of my LDAP Server which is Novell eDirectory. I have used openssl to connect to ldap to view the certificate.

openssl s_client -connect 192.168.1.225:636

它只是打印证书.如何将其保存到某个证书格式文件中?

It is just printing the certificate. How can I save this to some certificate format file?

推荐答案

复制-----BEGIN CERTIFICATE----------END CERTIFICATE之间的所有内容-----(包括这些分隔符)并将其粘贴到一个新的文本文件中(通常带有扩展名 .pem.crt).为此,您可以使用您最喜欢的(纯)文本编辑器,例如记事本、Gedit、Vim、Emacs(取决于您使用的系统).

Copy everything between -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- (including these delimiters) and paste it in a new text file (usually with the extension .pem or .crt). You can use your favourite (plain) text editor for this, for example Notepad, Gedit, Vim, Emacs (depending on the system you're using).

或者,您可以将输出通过管道传输到 sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p',如这里:

Alternatively, you can pipe the output to sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p', as described here:

echo -n | openssl s_client -connect 192.168.1.225:636 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ldapserver.pem

这篇关于如何从 OpenSSL 保存 LDAP SSL 证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆