-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from fukamachi/woo-ssl
SSL support with CL+SSL.
- Loading branch information
Showing
9 changed files
with
217 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ benchmark/benchmark.log | |
.qlot/ | ||
qlfile | ||
qlfile.lock | ||
t/certs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(defpackage woo.ssl | ||
(:use :cl) | ||
(:import-from :cl+ssl | ||
:with-new-ssl | ||
:install-nonblock-flag | ||
:ssl-set-fd | ||
:ssl-set-accept-state | ||
:*default-cipher-list* | ||
:ssl-set-cipher-list | ||
:with-pem-password | ||
:install-key-and-cert) | ||
(:import-from :woo.ev.socket | ||
:socket-fd | ||
:socket-ssl-handle) | ||
(:export :init-ssl-handle)) | ||
(in-package :woo.ssl) | ||
|
||
(defun init-ssl-handle (socket ssl-cert-file ssl-key-file ssl-key-password) | ||
(let ((client-fd (socket-fd socket))) | ||
(with-new-ssl (handle) | ||
(install-nonblock-flag client-fd) | ||
(ssl-set-fd handle client-fd) | ||
(ssl-set-accept-state handle) | ||
(when *default-cipher-list* | ||
(ssl-set-cipher-list handle *default-cipher-list*)) | ||
(setf (socket-ssl-handle socket) handle) | ||
(with-pem-password ((or ssl-key-password "")) | ||
(install-key-and-cert | ||
handle | ||
ssl-key-file | ||
ssl-cert-file)) | ||
socket))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
mkdir t/certs | ||
cd t/certs | ||
|
||
openssl genrsa -out localCA.key 2048 | ||
openssl req -batch -new -key localCA.key -out localCA.csr \ | ||
-subj "/C=JP/ST=Tokyo/L=Chuo-ku/O=\"Woo\"/OU=Development/CN=localhost" | ||
openssl x509 -req -days 3650 -signkey localCA.key -in localCA.csr -out localCA.crt | ||
openssl x509 -text -noout -in localCA.crt | ||
openssl genrsa -out localhost.key 2048 | ||
openssl req -batch -new -key localhost.key -out localhost.csr \ | ||
-subj "/C=JP/ST=Tokyo/L=Chuo-ku/O=\"Woo\"/OU=Development/CN=localhost" | ||
echo 'subjectAltName = DNS:localhost, DNS:localhost.localdomain, IP:127.0.0.1, DNS:app, DNS:app.localdomain' > localhost.csx | ||
openssl x509 -req -days 1825 -CA localCA.crt -CAkey localCA.key -CAcreateserial -in localhost.csr -extfile localhost.csx -out localhost.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters