You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
switch into new namespace: ``` kubectl config set-context --current --namespace=https-demo ```
37
-
48
+
switch into new namespace: ``` kubectl config set-context --current --namespace=https-demo ``
38
49
39
-
Then run ``` kubectl apply -f {eachyamlfile.yml} ```
50
+
Then run ``` kubectl apply -f ingress.yml ```
51
+
and two more time for the other 2 yml files.
40
52
41
53
This command will create each resource for you in your cluster.
42
54
43
55
At this point you can also start the ```minikube tunnel``` command in a seperate terminal so that your requests will be forwarded to localhost correctly.
44
56
57
+

58
+
45
59
## Step 3: Setting up your self signed CA and server certificate
46
60
47
61
We will be using our own self signed CA to sign both our server and client certificates using openSSL.
@@ -95,10 +109,11 @@ Let's see what will happen if we try to request our endpoint without passing a c
95
109
96
110
``` curl https://localhost/httpstest -k ```
97
111
98
-
note: we need to use the -k flag because we are using a self signed certificate for our server and CA meaning curl / browser doesn't trust it. This is fine for our demo purpose but in a real situation you'd never want to us a self signed CA or certificate.
112
+
note: we need to use the -k flag because we are using a self signed certificate for our server and CA meaning curl / browser doesn't trust it. This is fine for our demo purpose but in a real situation you'd never want to use a self signed CA or certificate.
99
113
100
-
We can see that we are returned a 400 error code that says No required SSL certificate was sent!
114
+

101
115
116
+
We can see that we are returned a 400 error code that says No required SSL certificate was sent!
102
117
103
118
Perfect, let's fix that by creating a client certificate that is signed by the CA it is expecting.
104
119
@@ -124,10 +139,11 @@ Now we can re try and see if we can access our resource!
124
139
125
140
We are passing in our client.crt and client.key with our request and receive a successful output from our application:
126
141
142
+

127
143
128
144
We can see that our app is saying Hello, world! It also included the Hostname which is equivalent to the pod that we created with our deployment.
129
145
You can confirm this by running a ``` kubectl get pods ``` command!
130
146
131
147
## Complete!
132
148
133
-
We have now set up our ingress nginx controller to enforce https / tls with the self signed CA and server cert we created using openssl, and have required the client to provide a certificate using the annotations in our ingress as well.
149
+
We have now set up our ingress nginx controller to enforce https / tls with the self signed CA and server cert we created using openssl, and have required the client to provide a certificate using the annotations in our ingress as well.
0 commit comments