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

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

问题描述

我想要我的LDAP服务器(即Novell eDirectory)的SSL证书.我已经使用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'. a>:

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天全站免登陆