|
82 | 82 | (doto (KeyStore/getInstance (KeyStore/getDefaultType)) (.load nil))) |
83 | 83 |
|
84 | 84 | (def test-ssl-options |
85 | | - {:port test-port |
86 | | - :ssl? true |
87 | | - :ssl-port test-ssl-port |
88 | | - :keystore nil-keystore |
89 | | - :key-password "hunter2" |
90 | | - :join? false}) |
| 85 | + {:port test-port |
| 86 | + :ssl? true |
| 87 | + :ssl-port test-ssl-port |
| 88 | + :keystore nil-keystore |
| 89 | + :key-password "hunter2" |
| 90 | + :join? false |
| 91 | + :sni-host-check? false}) |
91 | 92 |
|
92 | 93 | (deftest test-run-jetty |
93 | 94 | (testing "HTTP server" |
|
102 | 103 | (with-server hello-world {:port test-port |
103 | 104 | :ssl-port test-ssl-port |
104 | 105 | :keystore "test/keystore.jks" |
105 | | - :key-password "password"} |
| 106 | + :key-password "password" |
| 107 | + :sni-host-check? false} |
106 | 108 | (let [response (http/get test-ssl-url {:insecure? true})] |
107 | 109 | (is (= (:status response) 200)) |
108 | 110 | (is (= (:body response) "Hello World"))))) |
|
122 | 124 | :port test-port |
123 | 125 | :ssl-port test-ssl-port |
124 | 126 | :keystore "test/keystore.jks" |
125 | | - :key-password "password"} |
| 127 | + :key-password "password" |
| 128 | + :sni-host-check? false} |
126 | 129 | (let [response (http/get test-ssl-url {:insecure? true})] |
127 | 130 | (is (= (:status response) 200)) |
128 | 131 | (is (= (:body response) "Hello World"))) |
|
135 | 138 | :key-password "password" |
136 | 139 | :port test-port |
137 | 140 | :ssl? true |
138 | | - :ssl-port test-ssl-port} |
| 141 | + :ssl-port test-ssl-port |
| 142 | + :sni-host-check? false} |
139 | 143 | (is (thrown? java.io.IOException |
140 | 144 | (http/get test-ssl-url {:insecure? true})) |
141 | 145 | "missing client certs will cause an exception") |
|
153 | 157 | :key-password "password" |
154 | 158 | :port test-port |
155 | 159 | :ssl? true |
156 | | - :ssl-port test-ssl-port} |
| 160 | + :ssl-port test-ssl-port |
| 161 | + :sni-host-check? false} |
157 | 162 | (let [response (http/get test-ssl-url {:insecure? true |
158 | 163 | :throw-exceptions false})] |
159 | 164 | (is (= 403 (:status response)) |
|
169 | 174 | (testing "HTTPS server using :ssl-context" |
170 | 175 | (with-server hello-world {:port test-port |
171 | 176 | :ssl-port test-ssl-port |
172 | | - :ssl-context (ssl-context)} |
| 177 | + :ssl-context (ssl-context) |
| 178 | + :sni-host-check? false} |
173 | 179 | (let [response (http/get test-ssl-url {:insecure? true})] |
174 | 180 | (is (= (:status response) 200)) |
175 | 181 | (is (= (:body response) "Hello World"))))) |
|
179 | 185 | :ssl-context (ssl-context) |
180 | 186 | :port test-port |
181 | 187 | :ssl? true |
182 | | - :ssl-port test-ssl-port} |
| 188 | + :ssl-port test-ssl-port |
| 189 | + :sni-host-check? false} |
183 | 190 | (is (thrown? java.io.IOException |
184 | 191 | (http/get test-ssl-url {:insecure? true})) |
185 | 192 | "missing client certs will cause an exception") |
|
196 | 203 | :ssl-context (ssl-context) |
197 | 204 | :port test-port |
198 | 205 | :ssl? true |
199 | | - :ssl-port test-ssl-port} |
| 206 | + :ssl-port test-ssl-port |
| 207 | + :sni-host-check? false} |
200 | 208 | (let [response (http/get test-ssl-url {:insecure? true |
201 | 209 | :throw-exceptions false})] |
202 | 210 | (is (= 403 (:status response)) |
|
243 | 251 | :keystore "test/keystore.jks" |
244 | 252 | :key-password "password" |
245 | 253 | :join? false |
246 | | - :max-idle-time 5000}) |
| 254 | + :max-idle-time 5000 |
| 255 | + :sni-host-check? false}) |
247 | 256 | connectors (. server getConnectors)] |
248 | 257 | (is (= 5000 (. (first connectors) getIdleTimeout))) |
249 | 258 | (is (= 5000 (. (second connectors) getIdleTimeout))) |
|
254 | 263 | :ssl-port test-ssl-port |
255 | 264 | :keystore "test/keystore.jks" |
256 | 265 | :key-password "password" |
| 266 | + :sni-host-check? false |
257 | 267 | :join? false}) |
258 | 268 | connectors (. server getConnectors)] |
259 | 269 | (is (= 200000 (. (first connectors) getIdleTimeout))) |
|
0 commit comments