cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colm O hEigeartaigh (JIRA)" <>
Subject [jira] [Assigned] (CXF-7488) Protocol Mismatch when using Netty with TLS
Date Tue, 29 Aug 2017 15:16:00 GMT


Colm O hEigeartaigh reassigned CXF-7488:

    Assignee: Colm O hEigeartaigh

> Protocol Mismatch when using Netty with TLS
> -------------------------------------------
>                 Key: CXF-7488
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 3.1.12
>         Environment: Windows 7, JDK 1.8.0_144
>            Reporter: Lars Kaulen
>            Assignee: Colm O hEigeartaigh
>            Priority: Minor
> I'm using the classes NettyHttpServerEngineFactory and NettyHttpServerEngine to configure
a server with TLS using only Java code (without Spring or other XML configurations). Therefore
I constructed the necessary TLSServerParameters and created an engine factory:
> {noformat}
> TLSServerParameters tlsParams = new TLSServerParameters();
> tlsParams.setKeyManagers(km);
> tlsParams.setTrustManagers(tm);
> tlsParams.setCipherSuitesFilter(filter);
> tlsParams.setClientAuthentication(ca);
> NettyHttpServerEngineFactory factory = new NettyHttpServerEngineFactory(sf.getBus());
> Map<String, TLSServerParameters> tlsParamsMap = new HashMap<>();
> tlsParamsMap.put(Integer.toString(port), tlsParams);
> factory.setTlsServerParameters(tlsParamsMap);
> {noformat}
> Where sf is an object of JaxWsServerFactoryBean and I previously initialized all the
necessary KeyManagers etc.
> Afterwards I want to create an engine using the factory:
> {noformat}
> NettyHttpServerEngine engine = localFactory.createNettyHttpServerEngine(port, "https");
> {noformat}
> Afterwards I get the following Exception:
> {noformat}
> Protocol mismatch for port 4816: engine's protocol is http, the
url protocol is https
> 	at org.apache.cxf.transport.http.netty.server.NettyHttpServerEngineFactory.createNettyHttpServerEngine(
> 	at org.apache.cxf.transport.http.netty.server.NettyHttpServerEngineFactory.createNettyHttpServerEngine(
> {noformat}
> When looking at the (really similar) class ??JettyHTTPServerEngineFactory?? there is
a method ??retrieveListenerFactory?? called in methods ??setTlsServerParameters?? and ??finalizeConfig??
which changes the protocol of the engine to https when tls parameters are provided, in ??NettyHttpServerEngineFactory??
it doesn't exist so far and the ??finalizeConfig?? method is empty.
> Could you provide something similar to used code in ??JettyHTTPServerEngineFactory??
aswell in ??NettyHttpServerEngineFactory?? as it would solve my problems perfectly.
> Let me know if I need to provide any other informations/code.

This message was sent by Atlassian JIRA

View raw message