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

Netty4ClientHttpRequestFactory left uninitialized causing IllegalArgumentException: SSLContext is null #597

Closed
cfredri4 opened this issue Nov 19, 2020 · 1 comment
Labels
type: bug A general bug
Milestone

Comments

@cfredri4
Copy link

When:
Connecting to Vault over HTTPS
Not setting any SSL config
Having Netty on classpath

The below error is thrown.

It works fine without Netty on classpath.
It works fine with Netty if e.g. SSL trust store is set (e.g. spring.cloud.vault.ssl.trust-store).

2020-11-16 13:28:37.230+0000 [main] ERROR o.springframework.boot.SpringApplication vin=[] uid=[] req=[] - [reportFailure] Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'vaultPropertySourceLocator' defined in class path resource [org/springframework/cloud/vault/config/VaultBootstrapPropertySourceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.bootstrap.config.PropertySourceLocator]: Factory method 'vaultPropertySourceLocator' threw exception; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://vault.redacted.com:443/v1/redacted-kv/metadata/": null; nested exception is io.netty.channel.StacklessClosedChannelException
2020-11-16 13:31:07.321+0000 [main] WARN  o.s.v.a.LifecycleAwareSessionManager vin=[] uid=[] req=[] - [doGetSessionToken] Cannot enhance VaultToken to a LoginToken: Token self-lookup failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://vault.redacted.com:443/v1/auth/token/lookup-self": null; nested exception is io.netty.channel.StacklessClosedChannelException
2020-11-16 13:31:07.325+0000 [nioEventLoopGroup-2-2] WARN  io.netty.channel.ChannelInitializer vin=[] uid=[] req=[] - [exceptionCaught] Failed to initialize a channel. Closing: [id: 0x65b92ebd]
2020-11-16 13:31:07.308+0000 [nioEventLoopGroup-2-1] WARN  io.netty.channel.ChannelInitializer vin=[] uid=[] req=[] - [exceptionCaught] Failed to initialize a channel. Closing: [id: 0x5f7de2d2]
java.lang.IllegalArgumentException: sslContext should not be null

Possibly a default trust manager should be set in org.springframework.vault.client.ClientHttpConnectorFactory ?

@mp911de mp911de added the type: bug A general bug label Nov 19, 2020
@mp911de mp911de added this to the 2.2.3 milestone Dec 1, 2020
@mp911de mp911de changed the title 'java.lang.IllegalArgumentException: sslContext should not be null' when Netty is auto-detected (works fine without Netty on classpath) Netty4ClientHttpRequestFactory left uninitialized causing IllegalArgumentException: SSLContext is null Dec 1, 2020
mp911de added a commit that referenced this issue Dec 1, 2020
@mp911de mp911de closed this as completed in 927134f Dec 1, 2020
mp911de added a commit that referenced this issue Dec 1, 2020
@mp911de
Copy link
Member

mp911de commented Dec 1, 2020

Thanks a lot, that's fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants