Moderator: Pjirc Support Groupie
_provider=new DefaultSecuredProvider();_provider=new DefaultSecuredProviderSSL();package irc.security;
import java.io.*;
import java.net.*;
import javax.net.*;
import javax.net.ssl.*;
public class DefaultSecuredProviderSSL extends DefaultSecuredProvider
{
public final static int IRC_SECURE_PORT = 994; // IANA-assigned secure IRC
/*
* Get a new (SSL) Socket.
*
* If the port number matches the IANA-assigned secure port, an
* SSL socket will be created, if not an unsecure port.
* The certificate being used by the host server must be trusted by this
* Java Virtual Machine (JVM) either directly or through a Certificate
* Authority in <java-home>/lib/security/cacerts - if not you must
* manually add the server's certificate to the JVM's truststore.
* @param host server host
* @param port server SSL port
* @throws UnknownHostException if host is not found
* @throws IOException if an error occurs
*/
public Socket getSocket(String host, Integer port) throws
UnknownHostException, IOException
{
int portNum = port.intValue(); // convert to numeric
if(portNum == IRC_SECURE_PORT) { // secure port requested?
SocketFactory socketFactory = SSLSocketFactory.getDefault();
return socketFactory.createSocket(host, portNum);
}
else return super.getSocket(host,portNum);
}
public String getName() {
return "Default SSL Security Provider";
}
Connecting...
Logging in...
Error : sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Error : Connection has been shutdown: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Disconnected from 127.0.0.1
Connecting...
Anonymous wrote:Hi,
I becom this Error, I have many try but i don't know what is wrong. I hope someone can help me.Connecting...
Logging in...
Error : sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Error : Connection has been shutdown: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Disconnected from 127.0.0.1
Connecting...
Thx for the help
System.setProperty("javax.net.ssl.trustStore", System.getProperty( "user.home" ) + "/.keystore");keytool -genkey -alias blablehjarsigner C:/whatever/irc.jar.zip blablehkeytool -import -file C:/whatever/server.cert.pem -alias blablehopenssl s_client -connect irc.myircserver.net:6668go into the META-INF directory in the irc.jar.zip.
delete two files beginning with a "_".
Logging in....
Disconnected from naugthysmear.colorado.edu
SSLContext sslcontext = SSLContext.getInstance("TLS");SSLContext sslcontext = SSLContext.getInstance("SSL");C:\Program Files\Java\jdk1.5.0_05\bin>javac -nowarn -g:none -O -target 1.5 irc.j
ar\irc\*.java
irc.jar\irc\DefaultSecuredProviderSSL.java:19: cannot find symbol
symbol: class DefaultSecuredProvider
public class DefaultSecuredProviderSSL extends DefaultSecuredProvider {
^
irc.jar\irc\SecurityProvider.java:43: cannot find symbol
symbol : class SecuredProvider
location: class irc.security.SecurityProvider
private SecuredProvider _provider;
^
irc.jar\irc\DefaultSecuredProviderSSL.java:44: cannot find symbol
symbol : variable super
location: class irc.security.DefaultSecuredProviderSSL
else return super.getSocket(host,port);
^
irc.jar\irc\SecurityProvider.java:58: cannot find symbol
symbol : class SecuredProvider
location: class irc.security.SecurityProvider
SecuredProvider old=_provider;
^
irc.jar\irc\SecurityProvider.java:62: cannot find symbol
symbol : class SecuredProvider
location: class irc.security.SecurityProvider
_provider=(SecuredProvider)cl.newInstance();
output wrote:D:\Program Files\Java\jdk1.5.0_06\bin>javac -nowarn -g:none -O -target 1.5 E:\Software\Programming\pjirc\irc\security\SecurityProvider.java
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:43: cannot find symbol
symbol : class SecuredProvider
location: class irc.security.SecurityProvider
private SecuredProvider _provider;
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:53: cannot find
symbol
symbol : class DefaultSecuredProviderSSL
location: class irc.security.SecurityProvider
_provider=new DefaultSecuredProviderSSL();
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:58: cannot find
symbol
symbol : class SecuredProvider
location: class irc.security.SecurityProvider
SecuredProvider old=_provider;
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:62: cannot find
symbol
symbol : class SecuredProvider
location: class irc.security.SecurityProvider
_provider=(SecuredProvider)cl.newInstance();
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:94: cannot find
symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
Socket ans=(Socket)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_pr
ovider,"getSocket",new Object[] {host,new Integer(port)});
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:117: cannot fin
d symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (ServerSocket)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_
provider,"getServerSocket",new Object[] {new Integer(port)});
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:218: cannot fin
d symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (FileInputStream)EventDispatcher.dispatchEventAsyncAndWaitExSecurit
y(_provider,"getFileInputStream",new Object[] {file});
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:242: cannot fin
d symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (FileOutputStream)EventDispatcher.dispatchEventAsyncAndWaitExSecuri
ty(_provider,"getFileOutputStream",new Object[] {file});
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:263: cannot fin
d symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return ((Integer)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_prov
ider,"getFileSize",new Object[] {file})).intValue();
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:280: cannot fin
d symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (File)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider
,"getLoadFile",new Object[] {title});
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:297: cannot fin
d symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (File)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider
,"getSaveFile",new Object[] {title});
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:315: cannot fin
d symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (File)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider
,"getSaveFile",new Object[] {file,title});
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:332: cannot fin
d symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (InetAddress)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_p
rovider,"getLocalHost",new Object[] {});
^
E:\Software\Programming\pjirc\irc\security\SecurityProvider.java:353: cannot fin
d symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (String)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provid
er,"resolve",new Object[] {addr});
^
14 errors
D:\Program Files\Java\jdk1.5.0_06\bin>
DefaultSecuredProvider wrote:import javax.net.*; //Added Socketfactory functionality
/**
* Default secured provider.
*/
public class DefaultSecuredProvider implements SecuredProvider
{
public final static int IRC_SECURE_PORT = 6697;
public Socket getSocket(String host,Integer port) throws UnknownHostException,IOException
{
int portNum = port.intValue(); // convert to numeric
if(portNum == IRC_SECURE_PORT) // secure port requested?
{
SocketFactory socketFactory = DummySSLSocketFactory.getDefault();
return socketFactory.createSocket(host, portNum);
}
else return new Socket(host,port.intValue());
}
$ javac -nowarn -g:none -O -target 1.5 *.java
DefaultSecuredProviderSSL.java:19: cannot find symbol
symbol: class DefaultSecuredProvider
public class DefaultSecuredProviderSSL extends DefaultSecuredProvider {
^
SecurityProvider.java:43: cannot find symbol
symbol : class SecuredProvider
location: class irc.security.SecurityProvider
private SecuredProvider _provider;
^
DefaultSecuredProviderSSL.java:44: cannot find symbol
symbol : variable super
location: class irc.security.DefaultSecuredProviderSSL
else return super.getSocket(host,port);
^
SecurityProvider.java:58: cannot find symbol
symbol : class SecuredProvider
location: class irc.security.SecurityProvider
SecuredProvider old=_provider;
^
SecurityProvider.java:62: cannot find symbol
symbol : class SecuredProvider
location: class irc.security.SecurityProvider
_provider=(SecuredProvider)cl.newInstance();
^
SecurityProvider.java:94: cannot find symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
Socket ans=(Socket)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider,"getSocket",new Object[] {host,new Integer(port)});
^
SecurityProvider.java:117: cannot find symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (ServerSocket)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider,"getServerSocket",new Object[] {new Integer(port)});
^
SecurityProvider.java:218: cannot find symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (FileInputStream)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider,"getFileInputStream",new Object[] {file});
^
SecurityProvider.java:242: cannot find symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (FileOutputStream)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider,"getFileOutputStream",new Object[] {file});
^
SecurityProvider.java:263: cannot find symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return ((Integer)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider,"getFileSize",new Object[] {file})).intValue();
^
SecurityProvider.java:280: cannot find symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (File)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider,"getLoadFile",new Object[] {title});
^
SecurityProvider.java:297: cannot find symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (File)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider,"getSaveFile",new Object[] {title});
^
SecurityProvider.java:315: cannot find symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (File)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider,"getSaveFile",new Object[] {file,title});
^
SecurityProvider.java:332: cannot find symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (InetAddress)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider,"getLocalHost",new Object[] {});
^
SecurityProvider.java:353: cannot find symbol
symbol : variable EventDispatcher
location: class irc.security.SecurityProvider
return (String)EventDispatcher.dispatchEventAsyncAndWaitExSecurity(_provider,"resolve",new Object[] {addr});
^
15 errors
Users browsing this forum: No registered users and 0 guests