Skip to content

Commit d83648d

Browse files
scramjetztellman
authored andcommitted
Add :manual-ssl? option to HTTP start-server. (#423)
* Add :ssl? option to HTTP start-server. Support servers that wish to handle their own SSL setup, in particular SNI. * Mark project version witg mpp. * Rename :ssl? to :manual-ssl? * Change project name back.
1 parent 936561d commit d83648d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/aleph/http.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
| `socket-address` | a `java.net.SocketAddress` specifying both the port and interface to bind to.
3434
| `bootstrap-transform` | a function that takes an `io.netty.bootstrap.ServerBootstrap` object, which represents the server, and modifies it.
3535
| `ssl-context` | an `io.netty.handler.ssl.SslContext` object if an SSL connection is desired |
36+
| `manual-ssl?` | set to `true` to indicate that SSL is active, but the caller is managing it (this implies `:ssl-context` is nil). For example, this can be used if you want to use configure SNI (perhaps in `:pipeline-transform`) to select the SSL context based on the client's indicated host name. |
3637
| `pipeline-transform` | a function that takes an `io.netty.channel.ChannelPipeline` object, which represents a connection, and modifies it.
3738
| `executor` | a `java.util.concurrent.Executor` which is used to handle individual requests. To avoid this indirection you may specify `:none`, but in this case extreme care must be taken to avoid blocking operations on the handler's thread.
3839
| `shutdown-executor?` | if `true`, the executor will be shut down when `.close()` is called on the server, defaults to `true`.

src/aleph/http/server.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@
447447
bootstrap-transform
448448
pipeline-transform
449449
ssl-context
450+
manual-ssl?
450451
shutdown-executor?
451452
epoll?
452453
compression?]
@@ -477,7 +478,7 @@
477478
(pipeline-builder
478479
handler
479480
pipeline-transform
480-
(assoc options :executor executor :ssl? (boolean ssl-context)))
481+
(assoc options :executor executor :ssl? (or manual-ssl? (boolean ssl-context))))
481482
ssl-context
482483
bootstrap-transform
483484
(when (and shutdown-executor? (instance? ExecutorService executor))

0 commit comments

Comments
 (0)