• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 332
  • Last Modified:

(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

0
fredand44
Asked:
fredand44
1 Solution
 
suprapto45Commented:
Hi,

Maybe you can try Tomcat admin username and password. If you do not have 'admin' role, you need to add it :).

http://www.jguru.com/faq/view.jsp?EID=1087957

Regards
Dave
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now