forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
router_certs.go
123 lines (117 loc) · 6.83 KB
/
router_certs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package router
// These certificates are example certificates generated by a fake cert authority.
// In order to regenerate these certificates (or create new ones) you will need to grab the demo CA key
// which can be found https://github.com/pweil-/hello-nginx-docker. That repo contains all the keys found below, the
// CA configuration file used to sign the keys, and the CA keys themselves along with the CA database.
//
// The CA certificate/key was generated with:
// OPENSSL=ca.cnf openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -out mypersonalca/certs/ca.pem -outform PEM -keyout ./mypersonalca/private/ca.key
//
// In order to create new certificates you must first make a certificate request and key using openssl. You will be asked
// a series of questions. The important one is the Common Name. The certificates below marked Example* use www.example.com
// as the common name. Example2* uses www.example2.com as the common name
//
// openssl req -newkey rsa:1024 -nodes -sha1 -keyout cert.key -keyform PEM -out cert.req -outform PEM
//
// Once you have the request you then need to generate the the certificate with the authority key
// OPENSSL_CONF=ca.cnf openssl ca -batch -notext -in cert.req -out cert.pem
//
// To view your certificate via the command line:
// openssl x509 -in cert.pem -noout -text
var ExampleCert = `-----BEGIN CERTIFICATE-----
MIIDIjCCAgqgAwIBAgIBBjANBgkqhkiG9w0BAQUFADCBoTELMAkGA1UEBhMCVVMx
CzAJBgNVBAgMAlNDMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0Rl
ZmF1bHQgQ29tcGFueSBMdGQxEDAOBgNVBAsMB1Rlc3QgQ0ExGjAYBgNVBAMMEXd3
dy5le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