Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
acmeserver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
silver-platter
acmeserver
Commits
0cdc8fdc
Commit
0cdc8fdc
authored
5 years ago
by
godog
Browse files
Options
Downloads
Plain Diff
Merge branch 'cerbot_names' into 'master'
Switch to certbot pem names See merge request
!1
parents
a32c41b4
a5477d77
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manager_test.go
+1
-1
1 addition, 1 deletion
manager_test.go
storage.go
+3
-3
3 additions, 3 deletions
storage.go
with
4 additions
and
4 deletions
manager_test.go
+
1
−
1
View file @
0cdc8fdc
...
...
@@ -125,7 +125,7 @@ func TestManager_NewCert(t *testing.T) {
if
_
,
err
:=
os
.
Stat
(
p
);
err
!=
nil
{
t
.
Fatalf
(
"file not created: %v"
,
err
)
}
p
=
filepath
.
Join
(
m
.
configDirs
[
0
],
"../certs/example.com/priv
ate_
key.pem"
)
p
=
filepath
.
Join
(
m
.
configDirs
[
0
],
"../certs/example.com/privkey.pem"
)
if
_
,
err
:=
os
.
Stat
(
p
);
err
!=
nil
{
t
.
Fatalf
(
"file not created: %v"
,
err
)
}
...
...
This diff is collapsed.
Click to expand it.
storage.go
+
3
−
3
View file @
0cdc8fdc
...
...
@@ -25,7 +25,7 @@ type dirStorage struct {
func
(
d
*
dirStorage
)
GetCert
(
cn
string
)
([][]
byte
,
crypto
.
Signer
,
error
)
{
certPath
:=
filepath
.
Join
(
d
.
root
,
cn
,
"fullchain.pem"
)
keyPath
:=
filepath
.
Join
(
d
.
root
,
cn
,
"priv
ate_
key.pem"
)
keyPath
:=
filepath
.
Join
(
d
.
root
,
cn
,
"privkey.pem"
)
der
,
err
:=
parseCertsFromFile
(
certPath
)
if
err
!=
nil
{
...
...
@@ -53,7 +53,7 @@ func (d *dirStorage) PutCert(cn string, der [][]byte, key crypto.Signer) error {
for
path
,
data
:=
range
filemap
{
var
mode
os
.
FileMode
=
0644
if
strings
.
HasSuffix
(
path
,
"priv
ate_
key.pem"
)
{
if
strings
.
HasSuffix
(
path
,
"privkey.pem"
)
{
mode
=
0400
}
log
.
Printf
(
"writing %s (%03o)"
,
path
,
mode
)
...
...
@@ -83,7 +83,7 @@ func dumpCertsAndKey(cn string, der [][]byte, key crypto.Signer) (map[string][]b
if
err
!=
nil
{
return
nil
,
err
}
m
[
filepath
.
Join
(
cn
,
"priv
ate_
key.pem"
)]
=
data
m
[
filepath
.
Join
(
cn
,
"privkey.pem"
)]
=
data
return
m
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment