File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 732
732
http-versions
733
733
ssl-context
734
734
manual-ssl?
735
+ use-h2c?
735
736
shutdown-executor?
736
737
epoll?
737
738
transport
757
758
:ssl? (or manual-ssl? (boolean ssl-context))
758
759
:http1-pipeline-transform http1-pipeline-transform
759
760
:continue-executor continue-executor))]
761
+
762
+ (when (and (not ssl-context)
763
+ (not use-h2c?)
764
+ (some #{:http2 } http-versions))
765
+ (throw (IllegalArgumentException. " HTTP/2 requires ssl-context to be given or use-h2c? to be true." )))
766
+
760
767
(netty/start-server
761
768
{:pipeline-builder pipeline-builder
762
769
:bootstrap-transform bootstrap-transform
Original file line number Diff line number Diff line change 1403
1403
(testing " HTTP/2 without ssl-context"
1404
1404
(let [result (try-start-server
1405
1405
{:http-versions [:http2 ]})]
1406
- ; ; TODO: Shouldn't this fail?
1407
- (is (= :started result))))
1406
+ ( is ( instance? IllegalArgumentException result))
1407
+ (is (= " HTTP/2 requires ssl-context to be given or use-h2c? to be true. " ( ex-message result) ))))
1408
1408
(testing " HTTP/2 without ssl-context but with h2c"
1409
1409
(let [result (try-start-server
1410
1410
{:use-h2c? true
You can’t perform that action at this time.
0 commit comments