Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Truststore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
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
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
smallstep
Truststore
Commits
2c5ed10d
Commit
2c5ed10d
authored
6 years ago
by
Mariano Cano
Browse files
Options
Downloads
Patches
Plain Diff
Use certificate common name as default prefix.
parent
94e089c1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
truststore.go
+9
-2
9 additions, 2 deletions
truststore.go
with
9 additions
and
2 deletions
truststore.go
+
9
−
2
View file @
2c5ed10d
...
@@ -12,7 +12,7 @@ import (
...
@@ -12,7 +12,7 @@ import (
"os"
"os"
)
)
var
prefix
=
"
Truststore Development CA
"
var
prefix
=
""
var
enableDebug
bool
var
enableDebug
bool
func
debug
(
format
string
,
args
...
interface
{})
{
func
debug
(
format
string
,
args
...
interface
{})
{
...
@@ -214,7 +214,14 @@ func WithPrefix(s string) Option {
...
@@ -214,7 +214,14 @@ func WithPrefix(s string) Option {
}
}
func
uniqueName
(
cert
*
x509
.
Certificate
)
string
{
func
uniqueName
(
cert
*
x509
.
Certificate
)
string
{
return
prefix
+
cert
.
SerialNumber
.
String
()
switch
{
case
prefix
!=
""
:
return
prefix
+
cert
.
SerialNumber
.
String
()
case
cert
.
Subject
.
CommonName
!=
""
:
return
cert
.
Subject
.
CommonName
+
" "
+
cert
.
SerialNumber
.
String
()
default
:
return
"Truststore Development CA "
+
cert
.
SerialNumber
.
String
()
}
}
}
func
saveTempCert
(
cert
*
x509
.
Certificate
)
(
string
,
func
(),
error
)
{
func
saveTempCert
(
cert
*
x509
.
Certificate
)
(
string
,
func
(),
error
)
{
...
...
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