Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
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
Kirill Smelkov
go
Commits
43ae7da1
Commit
43ae7da1
authored
Mar 12, 2011
by
Dave Cheney
Committed by
Brad Fitzpatrick
Mar 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypto/tls: fix compile error
Fixes #1555. R=rsc, bradfitzgo CC=golang-dev
https://golang.org/cl/4284047
parent
3479bb6c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/pkg/crypto/tls/generate_cert.go
src/pkg/crypto/tls/generate_cert.go
+3
-3
No files found.
src/pkg/crypto/tls/generate_cert.go
View file @
43ae7da1
...
@@ -25,7 +25,7 @@ func main() {
...
@@ -25,7 +25,7 @@ func main() {
priv
,
err
:=
rsa
.
GenerateKey
(
rand
.
Reader
,
1024
)
priv
,
err
:=
rsa
.
GenerateKey
(
rand
.
Reader
,
1024
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Exit
f
(
"failed to generate private key: %s"
,
err
)
log
.
Fatal
f
(
"failed to generate private key: %s"
,
err
)
return
return
}
}
...
@@ -46,13 +46,13 @@ func main() {
...
@@ -46,13 +46,13 @@ func main() {
derBytes
,
err
:=
x509
.
CreateCertificate
(
rand
.
Reader
,
&
template
,
&
template
,
&
priv
.
PublicKey
,
priv
)
derBytes
,
err
:=
x509
.
CreateCertificate
(
rand
.
Reader
,
&
template
,
&
template
,
&
priv
.
PublicKey
,
priv
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Exit
f
(
"Failed to create certificate: %s"
,
err
)
log
.
Fatal
f
(
"Failed to create certificate: %s"
,
err
)
return
return
}
}
certOut
,
err
:=
os
.
Open
(
"cert.pem"
,
os
.
O_WRONLY
|
os
.
O_CREAT
,
0644
)
certOut
,
err
:=
os
.
Open
(
"cert.pem"
,
os
.
O_WRONLY
|
os
.
O_CREAT
,
0644
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Exit
f
(
"failed to open cert.pem for writing: %s"
,
err
)
log
.
Fatal
f
(
"failed to open cert.pem for writing: %s"
,
err
)
return
return
}
}
pem
.
Encode
(
certOut
,
&
pem
.
Block
{
Type
:
"CERTIFICATE"
,
Bytes
:
derBytes
})
pem
.
Encode
(
certOut
,
&
pem
.
Block
{
Type
:
"CERTIFICATE"
,
Bytes
:
derBytes
})
...
...
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