SSL support for inbound connections in Java

70 views
Skip to first unread message

umuta...@gmail.com

unread,
Dec 11, 2018, 7:56:19 AM12/11/18
to membrane-monitor
I am trying for days and dont have any option other than asking here...

I am trying to implement SSL for the service proxy. This works:

<serviceProxy port="9001">
<ssl>
<keystore location="../../conf/membrane.jks" password="secret" keyPassword="secret" />
</ssl>
<target host="1.2.3.4" port="8443">
<ssl endpointIdentificationAlgorithm=""> 
<truststore
                location="../../conf/membrane.jks" password="secret" />
</ssl>
</target>
</serviceProxy>

I couldnt make the same configuration work in java. Here is what i tried


 
ServiceProxy serviceProxy = new ServiceProxy();
 serviceProxy
.setPort(8080);


 serviceProxy
.setSslInboundParser(new SSLParser());
 serviceProxy
.getSslInboundParser().setKeyStore(new KeyStore());

 serviceProxy
.getSslInboundParser().getKeyStore().setLocation("C:\\Users\\10058933\\Downloads\\membrane-service-proxy-4.6.2\\conf\\membrane.jks");
 serviceProxy
.getSslInboundParser().getKeyStore().setPassword("secret");
 serviceProxy
.getSslInboundParser().getKeyStore().setKeyPassword("secret");


 serviceProxy
.getTarget().setHost("1.2.3.4");
 serviceProxy
.getTarget().setPort(8443);
 serviceProxy
.getTarget().setSslParser(new SSLParser());
 serviceProxy
.getTarget().getSslParser().setEndpointIdentificationAlgorithm("");


 serviceProxy
.getTarget().getSslParser().setTrustStore(new TrustStore());
 serviceProxy
.getTarget().getSslParser().getTrustStore().setLocation("C:\\Users\\10058933\\Downloads\\membrane-service-proxy-4.6.2\\conf\\membrane.jks");
 serviceProxy
.getTarget().getSslParser().getTrustStore().setPassword("secret");


 
HttpRouter router = new HttpRouter();
 router
.add(serviceProxy);
 router
.add(abstractServiceProxy);
 router
.init();





The outbound (target) SSL has no problems but inbound SSL has an error which is:

13:51:23,741 ERROR Header:149 - Header read line that caused problems: ‘ÊÊ        localhost   ÿ   
13:51:23,742 ERROR Header:149 - Header read line that caused problems:  
13:51:23,742 ERROR Header:149 - Header read line that caused problems: ºº   #    hhttp/1.1      
13:51:23,742 ERROR Header:149 - Header read line that caused problems:    3 + )ºº     .,Áëv6€.ÿO¨IGäÄFŽùHÖg,FäWÆ/? - +
13:51:23,760 DEBUG HttpServerHandler:79 - New ServerThread created. 2
13:51:23,761 ERROR Header:149 - Header read line that caused problems: ‘ºº        localhost   ÿ   
13:51:23,761 ERROR Header:149 - Header read line that caused problems:  
13:51:23,761 ERROR Header:149 - Header read line that caused problems: ZZ   #    hhttp/1.1      
13:51:23,761 ERROR Header:149 - Header read line that caused problems:    3 + )ZZ     Ë ˆëdbaä*÷k· Ô É ¿ „‚ eïú¹”y ˜G - +
13:51:28,904 TRACE ConnectionManager:212 - closing old connections


So what should I do to make it work on HTTPS port? What am I doing wrong?

Please help, I am out of options...

sudes...@gmail.com

unread,
Dec 23, 2019, 1:44:16 PM12/23/19
to membrane-monitor
Did we resolve this issue ? Am curious to know the approach as am facing the same 
Reply all
Reply to author
Forward
0 new messages