我的Python脚本失败了:
Traceback (most recent call last):
File "./inspect_sheet.py", line 21, in <module>
main()
File "./inspect_sheet.py", line 12, in main
workbook_name=workbook_name,
File "./google_sheets.py", line 56, in __init__
self.login()
File "./google_sheets.py", line 46, in login
self.client = gspread.authorize(credentials)
File "/usr/local/lib/python2.7/site-packages/gspread/client.py", line 335, in authorize
client.login()
File "/usr/local/lib/python2.7/site-packages/gspread/client.py", line 98, in login
self.auth.refresh(http)
File "/usr/local/lib/python2.7/site-packages/oauth2client/client.py", line 598, in refresh
self._refresh(http.request)
File "/usr/local/lib/python2.7/site-packages/oauth2client/client.py", line 769, in _refresh
self._do_refresh_request(http_request)
File "/usr/local/lib/python2.7/site-packages/oauth2client/client.py", line 795, in _do_refresh_request
body = self._generate_refresh_request_body()
File "/usr/local/lib/python2.7/site-packages/oauth2client/client.py", line 1425, in _generate_refresh_request_body
assertion …Run Code Online (Sandbox Code Playgroud) 我正在运行一个 Python 代码,我必须从HTTPSConnectionPool(host='ssd.jpl.nasa.gov', port=443). 但每次我尝试运行代码时都会收到以下错误。我的系统是 MAC 操作系统 12.1
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='ssd.jpl.nasa.gov', port=443): Max retries exceeded with url: /api/horizons.api?format=text&EPHEM_TYPE=OBSERVER&QUANTITIES_[...]_ (Caused by SSLError(SSLError(1, '[SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:997)')))
Run Code Online (Sandbox Code Playgroud)
我真的不知道如何绕过这个问题。
我正在尝试使用OpenSSL客户端验证在Ubuntu 10.10中与Experian的SSL连接.
openssl s_client -CApath /etc/ssl/certs/ -connect dm1.experian.com:443
Run Code Online (Sandbox Code Playgroud)
问题是连接以Verify返回代码关闭:21(无法验证第一个证书).
我检查了证书列表,用于签署Experian(VeriSign Class 3安全服务器CA-G3)的证书包含在列表中.
/etc/ssl/certs/ca-certificates.crt
Run Code Online (Sandbox Code Playgroud)
但我不知道为什么它无法验证第一张证书.提前致谢.
整个响应可以在这里看到:https: //gist.github.com/1248790
有没有办法让openssl滑动提示,例如
Country Name (2 letter code) [US]:
Organization Name (eg, company) [My Company Name LTD.]:
Common Name (eg, YOUR name) [something]:
Run Code Online (Sandbox Code Playgroud)
使用时创建证书
openssl req -config openssl.cnf -new -x509 ...
Run Code Online (Sandbox Code Playgroud)
鉴于这些参数在openssl.cnf文件中提供
例如
countryName = Country Name (2 letter code)
countryName_default = US
countryName_min = 2
countryName_max = 2
0.organizationName = Organization Name (eg, company)
0.organizationName_default = My Company Name LTD.
commonName = Common Name (eg, YOUR name)
commonName_max = 64
commonName_default = ${ENV::CN}
Run Code Online (Sandbox Code Playgroud) 我看了一下这个问题,并希望自己做.当我运行此代码时(直接从这个答案):
$textToEncrypt = "My super secret information.";
$encryptionMethod = "AES-256-CBC"; // AES is used by the U.S. gov't to encrypt top secret documents.
$secretHash = "25c6c7ff35b9979b151f2136cd13b0ff";
//To encrypt
$encryptedMessage = openssl_encrypt($textToEncrypt, $encryptionMethod, $secretHash, '1234567812345678');
//To Decrypt
$decryptedMessage = openssl_decrypt($encryptedMessage, $encryptionMethod, $secretHash);
//Result
echo "Encrypted: $encryptedMessage <br>Decrypted: $decryptedMessage";
Run Code Online (Sandbox Code Playgroud)
但是我得到了警告
openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and not recommended
Run Code Online (Sandbox Code Playgroud)
所以我去看看文档,但没有文档.我发现了这个评论,但仍然没有提到初始化矢量应该是什么以及我应该如何使用它.任何人都可以开导我吗?
我知道我本可以做更多的Google,但Stackoverflow首先出现在如此多的搜索结果中我认为这个问题对于遇到此问题的其他人可能会有用.
如何使用公钥加密大文件,以便除了拥有私钥的人之外没有人能够解密它?
我可以制作RSA公钥和私钥,但是在使用此命令加密大文件时:
openssl rsautl -encrypt -pubin -inkey public.pem -in myLargeFile.xml -out myLargeFile_encrypted.xml
Run Code Online (Sandbox Code Playgroud)
我怎样才能执行解密....
我通过以下命令创建我的私钥和公钥
openssl genrsa -out private.pem 1024
openssl rsa -in private.pem -out public.pem -outform PEM -pubout
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
RSA operation error
3020:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key size:.\crypto\rsa\rsa_pk1.c:151:
Run Code Online (Sandbox Code Playgroud)
我试图制作大小从1024到1200位的密钥,没有运气,同样的错误
在我的剧本中我有:
openssl req \
-x509 \
-new \
-nodes \
-key certs/ca/my-root-ca.key.pem \
-days 3652 \
-out certs/ca/my-root-ca.crt.pem \
-subj "/C=GB/ST=someplace/L=Provo/O=Achme/CN=${FQDN}"
Run Code Online (Sandbox Code Playgroud)
在Git Bash 3.1中在Windows上运行它给出:
Subject does not start with '/'.
Run Code Online (Sandbox Code Playgroud)
试图像这样逃避subj:-subj \"/ C = UK/ST = someplace/L = Provo/O = Achme/CN = $ {FQDN} \"
仍然无法正常工作.有任何想法吗?
我有一个C/C++应用程序,我需要创建一个包含公钥和私钥的X509 pem证书.证书可以是自签名的,也可以是未签名的,无关紧要.
我想在应用程序中执行此操作,而不是从命令行执行此操作.
什么OpenSSL功能会为我做这个?任何示例代码都是奖金!
我正在尝试编译一个包含以下内容的小型.c文件:
#include <openssl/ssl.h>
#include <openssl/rsa.h>
#include <openssl/x509.h>
#include <openssl/evp.h>
Run Code Online (Sandbox Code Playgroud)
在我拥有.c文件的同一个文件夹中,我有一个/ openssl包含所有这些文件(以及更多),同样在synaptic包管理器中我看到安装了OpenSSL,我试图用这个编译:
gcc -o Opentest Opentest.c -lcrypto
Run Code Online (Sandbox Code Playgroud)
但我总是得到错误:
error: openssl/ssl.h: No such file or directory
error: openssl/rsa.h: No such file or directory
error: openssl/x509.h: No such file or directory
error: openssl/evp.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我想编译的文件只是一个.c文件,没有Makefile或./configure.
我已经尝试过:
env CFLAGS=-I/path/to/openssl/
Run Code Online (Sandbox Code Playgroud)
并尝试再次编译,但我得到相同的错误.
我应该怎么做才能用openssl编译包括?
我正在开发一个TCP客户端来连接OpenSSL服务器和证书身份验证.我使用服务器团队共享的.crt和.key文件.这些证书由OpenSSL命令生成.
我使用的SslStream对象调用来验证TCP客户端SslStream.AuthenticateAsClient通过将服务器的方法IP,SslProtocols.Ssl3和X509CertificateCollection.
我收到以下错误:
身份验证失败,因为远程方已关闭传输流