我正在编写一个涉及CAS,jspring安全检查,重定向等的简单脚本.我想使用Kenneth Reitz的python请求,因为它是一项很棒的工作!但是,CAS需要通过SSL进行验证,因此我必须先通过该步骤.我不知道Python的要求是什么?这个SSL证书应该驻留在哪里?
Traceback (most recent call last):
File "./test.py", line 24, in <module>
response = requests.get(url1, headers=headers)
File "build/bdist.linux-x86_64/egg/requests/api.py", line 52, in get
File "build/bdist.linux-x86_64/egg/requests/api.py", line 40, in request
File "build/bdist.linux-x86_64/egg/requests/sessions.py", line 209, in request
File "build/bdist.linux-x86_64/egg/requests/models.py", line 624, in send
File "build/bdist.linux-x86_64/egg/requests/models.py", line 300, in _build_response
File "build/bdist.linux-x86_64/egg/requests/models.py", line 611, in send
requests.exceptions.SSLError: [Errno 1] _ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Run Code Online (Sandbox Code Playgroud) 我试图通过python发送推送通知到这里所述,但我收到以下错误:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/omat/CA/server/ca/models.py", line 193, in push
c.connect((host_name, 2195))
File "/usr/lib/python2.6/ssl.py", line 307, in connect
self.ca_certs)
SSLError: [Errno 336265225] _ssl.c:337: error:140B0009:SSL routines:
SSL_CTX_use_PrivateKey_file:PEM lib
Run Code Online (Sandbox Code Playgroud)
回溯说,错误是从python ssl模块中引发的,但是消息不对我唱歌.关于可能出错的任何想法?
谢谢,
OMAT
编辑:
使用的证书是根据证书和私钥创建的,如下所示:
openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
cat apns-dev-cert.pem apns-dev-key.pem > apns-dev.pem
Run Code Online (Sandbox Code Playgroud) 当我尝试通过 EC2 服务器在 Ubuntu 中启动 Jupyter Notebook 时遇到此问题。
SSLError: [SSL: EE_KEY_TOO_SMALL] ee 密钥太小 (_ssl.c:4022)
本来我有
权限错误 [Errno 13]
然后我按照此页面/home
并通过将文件夹和文件夹的所有权更改~/.local/share/jupyter/
为当前用户来修复它。
现在我遇到了 SSL 问题。我按照建议查看了此链接,但没有运气。
然后我cd
到我的证书文件夹,它就"mycert.pem"
在那里。我确信我将本地主机 IP 地址替换为"https://" amazon url
.
我的错误代码似乎也与这篇文章不相似,尽管我们的密钥都太小了。但我的是"ee key "
、 和"_ssl.c:4022"
,这与他们不同。
整个错误信息是这样的:
ubuntu@ip-172-31-15-155:~$ jupyter notebook
[I 16:53:35.24 NotebookApp] Serving notebooks from local directory: /home/ubuntu
[I 16:53:35.24 NotebookApp] Jupyter Notebook 6.4.0 is running at:
[I 16:53:35.24 NotebookApp] https://ip-172-31-15-155:8888/?token=5d6f7e3d198847e0b9008cff94deb68355701d6c6c983322
[I 16:53:35.24 NotebookApp] or https://127.0.0.1:8888/?token=5d6f7e3d198847e0b9008cff94deb68355701d6c6c983322 …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用python和django实现Apple推送通知.
我正在使用以下库来实现它
http://leepa.github.com/django-iphone-push/
这是我创建发送消息的代码
from django.http import HttpResponse
from django.utils import simplejson
import json
from push.models import iPhone
def SendMessage(request,data):
t = iPhone('XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX ') # 64 digit token
t.send_message("hi") # at this line i am getting ERROR
return HttpResponse(data,mimetype='application/javascript')
Run Code Online (Sandbox Code Playgroud)
settings.py
import os
PROJECT_ROOT = '/'
# Full path to the APN Certificate / Private Key .pem
IPHONE_SANDBOX_APN_PUSH_CERT = os.path.join(PROJECT_ROOT, "apns-dev-tubeteam.pem")
IPHONE_LIVE_APN_PUSH_CERT = os.path.join(PROJECT_ROOT, "apns-dev-tubeteam.pem")
# Set this to the hostname for the outgoing push server
IPHONE_SANDBOX_APN_HOST …
Run Code Online (Sandbox Code Playgroud) 我在虚拟机上运行 ubuntu 16.04(在 mac 上),在 aws ec2 ubuntu 18.04 上运行。我正在尝试运行 Jupiter 笔记本,aws.ec2
并尝试通过本地 Ubuntu 上的 Web 浏览器远程访问它。我能够访问远程 ubuntu(aws.ec2) 终端。在我按照此链接上的步骤操作后
我在第 9 步中遇到以下错误。
我从头开始重新安装了 3 次(包括本地 ubuntu 和 aws ec2 实例),但到目前为止没有任何进展。
Last login: Thu Nov 1 06:34:07 2018 from 134.1****
ubuntu@ip-172-***:~$ export XDG_RUNTIME_DIR=""
ubuntu@ip-172-***:~$ jupyter notebook
[I 06:40:19.525 NotebookApp] Serving notebooks from local directory: /home/ubuntu
[I 06:40:19.528 NotebookApp] The Jupyter Notebook is running at:
[I 06:40:19.528 NotebookApp] https:// **** :8888/?token=727fbb120d19f55a435c1*****
[I 06:40:19.528 NotebookApp] Use Control-C to stop this …
Run Code Online (Sandbox Code Playgroud) python ubuntu amazon-ec2 amazon-web-services jupyter-notebook