Add ssl cert for localhost
This commit is contained in:
parent
1783b00d2c
commit
4873a76a83
4 changed files with 29 additions and 3 deletions
|
|
@ -1,9 +1,12 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head><meta charset="utf-8" /></head>
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<canvas id="result" style="position: absolute; z-index: 10; transform: scale(-1, 1)"></canvas>
|
<canvas id="result" style="position: absolute; z-index: 10; transform: scale(-1, 1)"></canvas>
|
||||||
<video id="capture" playsinline style="transform: scale(-1, 1);"></video>
|
<video id="capture" playsinline style="transform: scale(-1, 1); max-width: 100%; height: auto; op"></video>
|
||||||
</body>
|
</body>
|
||||||
<script src="js/main.js"></script>
|
<script src="js/main.js"></script>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
{:deps true
|
{:deps true
|
||||||
|
:ssl {:keystore "ssl/localhost.jks"
|
||||||
|
:password "shadow-cljs"}
|
||||||
:dev-http {8080 "resources/public"}
|
:dev-http {8080 "resources/public"}
|
||||||
:builds
|
:builds
|
||||||
{:app {:target :browser
|
{:app {:target :browser
|
||||||
|
|
|
||||||
7
ssl/generate.sh
Normal file
7
ssl/generate.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Generates a new certificate that can be used for localhost by shadow-cljs# the certificate can be configured in localhost.conf
|
||||||
|
|
||||||
|
openssl req -x509 -out localhost.crt -keyout localhost.key -newkey rsa:2048 -nodes -sha256 -subj /CN=localhost -extensions EXT -config localhost.conf
|
||||||
|
openssl pkcs12 -export -in localhost.crt -inkey localhost.key -out localhost.p12
|
||||||
|
keytool -importkeystore -srckeystore localhost.p12 -srcstoretype PKCS12 -destkeystore localhost.jks -deststoretype JKS
|
||||||
14
ssl/localhost.conf
Normal file
14
ssl/localhost.conf
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
[dn]
|
||||||
|
CN = localhost
|
||||||
|
|
||||||
|
[req]
|
||||||
|
distinguished_name = dn
|
||||||
|
|
||||||
|
[EXT]
|
||||||
|
subjectAltName = @alternate_names
|
||||||
|
keyUsage = digitalSignature
|
||||||
|
extendedKeyUsage = serverAuth
|
||||||
|
|
||||||
|
[alternate_names]
|
||||||
|
DNS.1 = localhost
|
||||||
|
DNS.2 = odroidxu4.lan
|
||||||
Loading…
Add table
Add a link
Reference in a new issue