标签: openssl

如何使用OpenSSL创建自签名证书

我正在为嵌入式Linux设备添加HTTPS支持.我尝试使用以下步骤生成自签名证书:

openssl req -new > cert.csr
openssl rsa -in privkey.pem -out key.pem
openssl x509 -in cert.csr -out cert.pem -req -signkey key.pem -days 1001
cat key.pem>>cert.pem
Run Code Online (Sandbox Code Playgroud)

这有效,但我在使用Google Chrome时遇到了一些错误:

这可能不是您要找的网站!
该网站的安全证书不受信任!

我错过了什么吗?这是构建自签名证书的正确方法吗?

ssl openssl certificate ssl-certificate x509certificate

1169
推荐指数
18
解决办法
139万
查看次数

如何从.key和.crt文件获取.pem文件?

如何从SSL证书创建PEM文件?

这些是我提供的文件:

  • .crt
  • server.csr
  • server.key

ssl openssl asn.1 pem der

561
推荐指数
10
解决办法
92万
查看次数

使用OpenSSL"无法写'随机状态'"是什么意思?

我正在生成一个自签名SSL证书来保护我服务器的管理部分,我不断从OpenSSL收到此消息:

无法写'随机状态'

这是什么意思?

这是在Ubuntu服务器上.我已升级libssl以修复最近的安全漏洞.

openssl

397
推荐指数
8
解决办法
23万
查看次数

使用RSA私钥生成公钥?

我真的不明白这个:

根据:http://www.madboa.com/geek/openssl/#key-rsa,您可以从私钥生成公钥.

openssl genrsa -out mykey.pem 1024
openssl rsa -in mykey.pem -pubout > mykey.pub
Run Code Online (Sandbox Code Playgroud)

我最初的想法是,它们是一起生成的.RSA私钥是否包含总和?还是公钥?

openssl rsa public-key-encryption

368
推荐指数
8
解决办法
46万
查看次数

使用openssl从服务器获取证书

我正在尝试获取远程服务器的证书,然后我可以使用它来添加到我的密钥库并在我的java应用程序中使用.

一位资深开发者(节假日:())告诉我,我可以运行这个:

openssl s_client -connect host.host:9999
Run Code Online (Sandbox Code Playgroud)

要获取原始证书,我可以将其复制并导出.我收到以下输出:

depth=1 /C=NZ/ST=Test State or Province/O=Organization Name/OU=Organizational Unit Name/CN=Test CA
verify error:num=19:self signed certificate in certificate chain
verify return:0
23177:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1086:SSL alert number 40
23177:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188:
Run Code Online (Sandbox Code Playgroud)

我也试过这个选项

-showcerts 
Run Code Online (Sandbox Code Playgroud)

而这一个(在debian上运行你的头脑)

-CApath /etc/ssl/certs/ 
Run Code Online (Sandbox Code Playgroud)

但得到同样的错误.

这个消息来源说我可以使用那个CApath标志,但它似乎没有帮助.我尝试了多条路径无济于事.

请让我知道我哪里出错了.

linux security openssl certificate ssl-certificate

314
推荐指数
12
解决办法
61万
查看次数

如何从PEM编码的证书中确定SSL证书的到期日期?

如果我在Mac或Linux中有实际文件和Bash shell,我如何查询cert文件何时到期?假设我有csr,key,pem和chain文件,这不是一个网站,而是实际上是证书文件本身.

bash ssl openssl certificate

278
推荐指数
7
解决办法
29万
查看次数

gem eventmachine致命错误:找不到'openssl/ssl.h'文件

刚安装El Capitan并且无法安装gem eventmachine 1.0.7.openssl1.0.2a-1.试图使用--with-ssl-dir但似乎被忽略了.

报告给他们的github回购也.

任何建议都非常感谢.谢谢.

$ ls /usr/local/Cellar/openssl/1.0.2a-1/include/openssl/ssl.h
/usr/local/Cellar/openssl/1.0.2a-1/include/openssl/ssl.h

$ gem install eventmachine -v '1.0.7' -- --with-ssl-dir=/usr/local/Cellar/openssl/1.0.2a-1/include
/Users/pain/.rbenv/versions/2.1.2/bin/ruby -r ./siteconf20150612-56154-1hsjz2n.rb extconf.rb --with-ssl-dir=/usr/local/Cellar/openssl/1.0.2a-1/include
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes …
Run Code Online (Sandbox Code Playgroud)

ruby macos homebrew openssl eventmachine

265
推荐指数
10
解决办法
6万
查看次数

找不到Ruby Bundle符号:_SSLv2_client_method(LoadError)

我正在尝试使用自制软件对openssl进行一些更新,但我设法破坏了一切.我现在无法做任何事情,这是我尝试进行捆绑安装时得到的结果:

$ bundle install
/Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in    `require': dlopen(/Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method (LoadError)
Referenced from: /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
in /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle - /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/openssl.rb:17:in `<top (required)>'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/security.rb:11:in `<top (required)>'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/package.rb:43:in `<top (required)>'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/dependency_installer.rb:3:in `<top (required)>'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/installer.rb:2:in `<top (required)>'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli/install.rb:78:in `run'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli.rb:146:in `install'
    from /Users/asServer/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor/command.rb:27:in `run'
    from …
Run Code Online (Sandbox Code Playgroud)

homebrew openssl ruby-on-rails rbenv

249
推荐指数
6
解决办法
5万
查看次数

使用任何 hg mercurial 命令时出现“错误:root:未找到哈希 md5 的代码”

尝试hg在控制台上使用任何Mercurial 命令时,我不断收到此错误。我使用 Homebrew 安装了 Python,我正在运行 Mac OS Catalina v. 10.15.1。

任何参考将不胜感激。这是我得到的错误:

hg commit --amend
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.15_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.15_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, …
Run Code Online (Sandbox Code Playgroud)

python macos mercurial homebrew openssl

227
推荐指数
5
解决办法
11万
查看次数

如何在Ubuntu上安装OpenSSL库?

我正在尝试在使用OpenSSL 1.0.0的Ubuntu 10.04 LTS上构建一些代码.当我运行make时,它使用"-lssl"选项调用g ++.来源包括:

#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/des.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/rsa.h>
Run Code Online (Sandbox Code Playgroud)

我跑了:

$ sudo apt-get install openssl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
openssl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Run Code Online (Sandbox Code Playgroud)

但我想openssl包不包含库.我在make上遇到这些错误:

foo.cpp:21:25: error: openssl/bio.h: No such file or directory
foo.cpp:22:28: error: openssl/buffer.h: No such file or directory
foo.cpp:23:25: error: openssl/des.h: No such file or directory
foo.cpp:24:25: error: openssl/evp.h: …
Run Code Online (Sandbox Code Playgroud)

c++ installation ubuntu openssl

214
推荐指数
6
解决办法
36万
查看次数