tbboyett
asked on
RMI connection through firewall
Hey guys, i needs some help.
I have an application that works fine over the intranet at work using rmi, but what I need to do is be able to run the application at say home and connect the very same.
I have a port open to where i can connect to the server through the firewall but not sure how to proceed.
My current RMI setup is something like this
// Create registry.
java.rmi.registry.LocateRe gistry.cre ateRegistr y(1099);
// Set security manager.
System.setSecurityManager( new RMISecurityManager());
// Bind to server
serverObject = (DataServerInterface) Naming.lookup("//" + "<ip>:<port of registry>" + "/<name>");
In DataServer constructor I do the following
-------------------------- ---------- ---------- ---------- ---------- -
Naming.rebind("//<ip>:<por t of registry>/<name>", this);
what steps do i need to take to make it work through the firewall? any help is greatly appreciated.
Also, what's the best way to secure it, since it's going to be over the internet?
Thanks, in advance
I have an application that works fine over the intranet at work using rmi, but what I need to do is be able to run the application at say home and connect the very same.
I have a port open to where i can connect to the server through the firewall but not sure how to proceed.
My current RMI setup is something like this
// Create registry.
java.rmi.registry.LocateRe
// Set security manager.
System.setSecurityManager(
// Bind to server
serverObject = (DataServerInterface) Naming.lookup("//" + "<ip>:<port of registry>" + "/<name>");
In DataServer constructor I do the following
--------------------------
Naming.rebind("//<ip>:<por
what steps do i need to take to make it work through the firewall? any help is greatly appreciated.
Also, what's the best way to secure it, since it's going to be over the internet?
Thanks, in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm trying to run the rmisample from the link you provided and it compiles fine and the server runs fine, but when i run the client I get this error:
HelloClient exception: error during JRMP connection establishment; nested exception is:
javax.net.ssl.SSLHandshake Exception: sun.security.validator.Val idatorExce ption: PKIX path building failed: sun.security.provider.cert path.SunCe rtPathBuil derExcepti on: unable to find valid certification path to requested target
java.rmi.ConnectIOExceptio n: error during JRMP connection establishment; nested exception is:
javax.net.ssl.SSLHandshake Exception: sun.security.validator.Val idatorExce ption: PKIX path building failed: sun.security.provider.cert path.SunCe rtPathBuil derExcepti on: unable to find valid certification path to requested target
at sun.rmi.transport.tcp.TCPC hannel.cre ateConnect ion(TCPCha nnel.java: 274)
at sun.rmi.transport.tcp.TCPC hannel.new Connection (TCPChanne l.java:171 )
at sun.rmi.server.UnicastRef. invoke(Uni castRef.ja va:94)
at HelloImpl_Stub.sayHello(Un known Source)
at HelloClient.main(HelloClie nt.java:57 )
Caused by: javax.net.ssl.SSLHandshake Exception: sun.security.validator.Val idatorExce ption: PKIX path building failed: sun.security.provider.cert path.SunCe rtPathBuil derExcepti on: unable to find valid certification path to requested target
at com.sun.net.ssl.internal.s sl.Alerts. getSSLExce ption(Aler ts.java:15 0)
at com.sun.net.ssl.internal.s sl.SSLSock etImpl.fat al(SSLSock etImpl.jav a:1476)
at com.sun.net.ssl.internal.s sl.Handsha ker.fatalS E(Handshak er.java:17 4)
at com.sun.net.ssl.internal.s sl.Handsha ker.fatalS E(Handshak er.java:16 8)
at com.sun.net.ssl.internal.s sl.ClientH andshaker. serverCert ificate(Cl ientHandsh aker.java: 847)
at com.sun.net.ssl.internal.s sl.ClientH andshaker. processMes sage(Clien tHandshake r.java:106 )
at com.sun.net.ssl.internal.s sl.Handsha ker.proces sLoop(Hand shaker.jav a:495)
at com.sun.net.ssl.internal.s sl.Handsha ker.proces s_record(H andshaker. java:433)
at com.sun.net.ssl.internal.s sl.SSLSock etImpl.rea dRecord(SS LSocketImp l.java:815 )
at com.sun.net.ssl.internal.s sl.SSLSock etImpl.per formInitia lHandshake (SSLSocket Impl.java: 1025)
at com.sun.net.ssl.internal.s sl.SSLSock etImpl.wri teRecord(S SLSocketIm pl.java:61 9)
at com.sun.net.ssl.internal.s sl.AppOutp utStream.w rite(AppOu tputStream .java:59)
at java.io.BufferedOutputStre am.flushBu ffer(Buffe redOutputS tream.java :65)
at java.io.BufferedOutputStre am.flush(B ufferedOut putStream. java:123)
at java.io.DataOutputStream.f lush(DataO utputStrea m.java:106 )
at sun.rmi.transport.tcp.TCPC hannel.cre ateConnect ion(TCPCha nnel.java: 198)
... 4 more
Caused by: sun.security.validator.Val idatorExce ption: PKIX path building failed: sun.security.provider.cert path.SunCe rtPathBuil derExcepti on: unable to find valid certification path to requested target
at sun.security.validator.PKI XValidator .doBuild(P KIXValidat or.java:22 1)
at sun.security.validator.PKI XValidator .engineVal idate(PKIX Validator. java:145)
at sun.security.validator.Val idator.val idate(Vali dator.java :203)
at com.sun.net.ssl.internal.s sl.X509Tru stManagerI mpl.checkS erverTrust ed(X509Tru stManagerI mpl.java:1 72)
at com.sun.net.ssl.internal.s sl.JsseX50 9TrustMana ger.checkS erverTrust ed(SSLCont extImpl.ja va:320)
at com.sun.net.ssl.internal.s sl.ClientH andshaker. serverCert ificate(Cl ientHandsh aker.java: 840)
... 15 more
Caused by: sun.security.provider.cert path.SunCe rtPathBuil derExcepti on: unable to find valid certification path to requested target
at sun.security.provider.cert path.SunCe rtPathBuil der.engine Build(SunC ertPathBui lder.java: 236)
at java.security.cert.CertPat hBuilder.b uild(CertP athBuilder .java:194)
at sun.security.validator.PKI XValidator .doBuild(P KIXValidat or.java:21 6)
... 20 more
Do you have any ideas as to what would cause this? Sorry, new to this area of java. Thanks
HelloClient exception: error during JRMP connection establishment; nested exception is:
javax.net.ssl.SSLHandshake
java.rmi.ConnectIOExceptio
javax.net.ssl.SSLHandshake
at sun.rmi.transport.tcp.TCPC
at sun.rmi.transport.tcp.TCPC
at sun.rmi.server.UnicastRef.
at HelloImpl_Stub.sayHello(Un
at HelloClient.main(HelloClie
Caused by: javax.net.ssl.SSLHandshake
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at java.io.BufferedOutputStre
at java.io.BufferedOutputStre
at java.io.DataOutputStream.f
at sun.rmi.transport.tcp.TCPC
... 4 more
Caused by: sun.security.validator.Val
at sun.security.validator.PKI
at sun.security.validator.PKI
at sun.security.validator.Val
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
at com.sun.net.ssl.internal.s
... 15 more
Caused by: sun.security.provider.cert
at sun.security.provider.cert
at java.security.cert.CertPat
at sun.security.validator.PKI
... 20 more
Do you have any ideas as to what would cause this? Sorry, new to this area of java. Thanks
ASKER