Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
9f9de389
Commit
9f9de389
authored
Oct 17, 2015
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lego provides PEM-encoded certificate bytes for us
parent
7568b0e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
14 deletions
+1
-14
config/letsencrypt/crypto.go
config/letsencrypt/crypto.go
+0
-13
config/letsencrypt/letsencrypt.go
config/letsencrypt/letsencrypt.go
+1
-1
No files found.
config/letsencrypt/crypto.go
View file @
9f9de389
...
...
@@ -8,19 +8,6 @@ import (
"os"
)
// saveCertificate saves a DER-encoded (binary format) certificate
// to file.
func
saveCertificate
(
certBytes
[]
byte
,
file
string
)
error
{
pemCert
:=
pem
.
Block
{
Type
:
"CERTIFICATE"
,
Bytes
:
certBytes
}
certOut
,
err
:=
os
.
Create
(
file
)
if
err
!=
nil
{
return
err
}
pem
.
Encode
(
certOut
,
&
pemCert
)
certOut
.
Close
()
return
nil
}
// loadRSAPrivateKey loads a PEM-encoded RSA private key from file.
func
loadRSAPrivateKey
(
file
string
)
(
*
rsa
.
PrivateKey
,
error
)
{
keyBytes
,
err
:=
ioutil
.
ReadFile
(
file
)
...
...
config/letsencrypt/letsencrypt.go
View file @
9f9de389
...
...
@@ -144,7 +144,7 @@ func saveCertsAndKeys(certificates []acme.CertificateResource) error {
os
.
MkdirAll
(
storage
.
Site
(
cert
.
Domain
),
0700
)
// Save cert
err
:=
saveCertificate
(
cert
.
Certificate
,
storage
.
SiteCertFile
(
cert
.
Domain
)
)
err
:=
ioutil
.
WriteFile
(
storage
.
SiteCertFile
(
cert
.
Domain
),
cert
.
Certificate
,
0600
)
if
err
!=
nil
{
return
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment