(Tomcat) How to set username and password for SSL to avoid 401
Hello!I try to access a webservices with SSL. Everything seems to be OK but I get a (401)Unauthorized response. My investigation has led to I suspect that the problem must be that I need to apply the correct username and password.
But what is the correct username and password????
I use Tomcat 5.5.9 and axis.
I have tried with:
user_name
user_pass
My_windows_XP_log_in_user_name
My_windows_XP_log_in_user_pass
keystorePass and the name set in the keystore
But no luck at all.
My code looks like:
SSLSoapWsdlServerServiceLocator sslSoapWsdlServerServiceLocator = new SSLSoapWsdlServerServiceLocator();
SSLSoapWsdlServerSoapBindingStub sslSoapWsdlServerSoapBindingStub = (SSLSoapWsdlServerSoapBindingStub) sslSoapWsdlServerServiceLocator.getSSLSoapWsdlServer(new URL("https://localhost:8443/axis/services/SSLSoapWsdlServer"));
sslSoapWsdlServerSoapBindingStub.setUsername("Frean");
sslSoapWsdlServerSoapBindingStub.setPassword("xxxxxx");
String returned = (String)sslSoapWsdlServerSoapBindingStub.getPrime("someString");
System.out.println( "Soap returned: " + returned );
I do not know where I find the username and password to use. I have not set anything like that in my Tomcat.
So if you know where to find or config this please let me know!!
Best regards
Fredrik