Skip to content

Commit

Permalink
add script to generate cert
Browse files Browse the repository at this point in the history
  • Loading branch information
BeryJu committed Feb 21, 2022
1 parent ae03e21 commit 9312391
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
saml-sp.key
saml-sp.pem
5 changes: 5 additions & 0 deletions mkcert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
-keyout saml-sp.key -out saml-sp.pem -subj "/CN=localhost"
export SP_SSL_CERT=./saml-sp.pem
export SP_SSL_KEY=./saml-sp.key
1 change: 1 addition & 0 deletions pkg/server/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func RunServer() {
server.l.Infof("ACS URL is '%s'", samlSP.ServiceProvider.AcsURL.String())

if _, set := os.LookupEnv("SP_SSL_CERT"); set {
server.l.Info("SSL enabled")
// SP_SSL_CERT set, so we run SSL mode
err := http.ListenAndServeTLS(listen, os.Getenv("SP_SSL_CERT"), os.Getenv("SP_SSL_KEY"), server.logRequest(server.h))
if err != nil {
Expand Down

0 comments on commit 9312391

Please sign in to comment.