Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay server startup #12

Open
jameskleeh opened this issue May 17, 2020 · 2 comments · May be fixed by #23
Open

Delay server startup #12

jameskleeh opened this issue May 17, 2020 · 2 comments · May be fixed by #23
Assignees
Labels
status: pr submitted A pull request has been submitted for the issue type: bug Something isn't working

Comments

@jameskleeh
Copy link
Contributor

Currently the channel is getting initialized before the acme setup is done and is causing this exception:

00:38:15.311 [nioEventLoopGroup-1-2] WARN  io.netty.channel.ChannelInitializer - Failed to initialize a channel. Closing: [id: 0x6816b54e, L:/10.128.0.3:443 - R:/24.154.202.70:55297]
java.lang.NullPointerException: null
	at io.micronaut.configuration.acme.ssl.DelegatedSslContext.newEngine(DelegatedSslContext.java:79)
	at io.netty.handler.ssl.SslContext.newHandler(SslContext.java:953)
	at io.netty.handler.ssl.SslContext.newHandler(SslContext.java:945)
	at io.micronaut.http.server.netty.NettyHttpServer$NettyHttpServerInitializer.initChannel(NettyHttpServer.java:746)
	at io.micronaut.http.server.netty.NettyHttpServer$NettyHttpServerInitializer.initChannel(NettyHttpServer.java:734)

The refresh task should probably listen to io.micronaut.context.event.StartupEvent and block until its finished

@zendern
Copy link
Collaborator

zendern commented May 19, 2020

@jameskleeh In regards to listening to StartupEvent over the existing ApplicationStartupEvent found here.

@EventListener
void onStartup(ApplicationStartupEvent startupEvent) throws AcmeException {
renewCertIfNeeded();
}

I believe that would only work in the DNS Challenge type case since it doesn't require the application to actually respond to requests from the ACME server. Both the TLS and HTTP challenge types have endpoints that get setup as part of the application so that the ACME validation steps can be done. Switching to listening to StartupEvent appears to be before those are actually up and running so idk if that is possible but if you have thoughts I'm open to changing it.

@jameskleeh
Copy link
Contributor Author

@zendern Seems like there is a bunch of work that could be done prior though. Seems like the order can be created, and then do the authorizations in the current event listener

@zendern zendern linked a pull request Jun 24, 2020 that will close this issue
@alvarosanchez alvarosanchez linked a pull request Jul 27, 2020 that will close this issue
@alvarosanchez alvarosanchez added the type: bug Something isn't working label Jul 27, 2020
@guillermocalvo guillermocalvo self-assigned this Aug 8, 2023
@guillermocalvo guillermocalvo added the status: pr submitted A pull request has been submitted for the issue label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pr submitted A pull request has been submitted for the issue type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants