HTTPS server with the new Karrigell 2.4 version.
来源:互联网 发布:c语言code是什么意思 编辑:程序博客网 时间:2024/06/06 16:25
It's really simple. You have to install (at least) TLSlite. (M2Crypto
and OpenSSL are also recommended)
Create a copy of SimpleAsyncHTTPServer.py as
SimpleAsyncHTTPSServer.py. Then apply the following additions or
changes:
in the Import section add:
from tlslite.api import *
s = open("./serverX509Cert.pem").read()
x509 = X509()
x509.parse(s)
certChain = X509CertChain([x509])
s = open("./serverX509Key.pem").read()
privateKey = parsePEMKey(s, private=True)
sessionCache = SessionCache()
(the files serverX509Cert.pem and serverX509Key.pem are taken from the
test folder of TSLlite; they are not valid any more but still work for
testing. I did not manage to create may own pem files yet. Place them
in the main Karrigell folder.)
in class server, the function accept_new_client hast to be replaced
with the following:
def accept_new_client(self):
try:
request, client_address = self.socket.accept()
connection = TLSConnection(request)
connection.handshakeServer(certChain=certChain,privateKey=privateKey,sessionCache=sessionCache)
connection.settimeout(0)
except TLSError:
return
self.client_handlers[request] = self.RequestHandlerClass(self,
connection, client_address)
Now modify the Karrigell.py script (or a copy named "Karrigell
SSL.py") to import from SimpleAsyncHTTPSServer.py instead of
SimpleAsyncHTTPServer.py.
That's all. If you do not use port 443, you have to set the port in
your browser, like "https://localhost:8080".
All the demos etc. seem to work fine. I have not adapted my own
applications to Karrigell 2.4 yet.
Guenter
- HTTPS server with the new Karrigell 2.4 version.
- set up your enviroment with the new version to continue you development.
- https server with openssl 笔记
- Server IPC version 9 cannot communicate with client version 4
- server ipc version 9 cannot communicate with client version 3
- Server IPC version 9 cannot communicate with client version 4
- The Grabber 1.4.4c Beta 3 (The New Version!)
- Out With the Old and in With the New
- Blogging with the New Google™ Blogger
- NFS4 the new version of nfs service in 11.31
- This version of android studio is incompatible with the gradle version used.Try disabling the instan
- VC9 SP1 generates manifests with the wrong version number
- GL version 2.1 with the gpu_shader extension is not supported...
- 101 The One Where Monica Gets a New Roommate (The Pilot-The Uncut Version)
- Setup https server with a self SSL certificate for testing.
- XAMPP: SSL Encrypt the Transmission of Passwords with https
- Hadoop Eclipse Server IPC version 5 cannot communicate with client version 3
- Remo TteException:Server IPC version 9 cannot communicate with client version 4
- 一个农村硕士生所经历的大学无用论和大学致贫论
- 同志们注意啦~星座改日期了...
- H.264视频编解码的代码移植和优化
- web.config文件配置
- [方法]按日期测试时间跨度问题--时间差(小时,分钟,秒)
- HTTPS server with the new Karrigell 2.4 version.
- js字符串怎么样转化为日期类型
- Apache Byte Code Engineering Library (BCEL)简介
- 毁人不倦的应试教育
- 哲言
- 鼠标移动连接样式
- 父窗口概念
- 哈利路亚
- ESX 3.5 简单学习笔记