Re: SSL question
Hi Not exactly sure what you mean. Could you send me a snippet of your web.xml? That would be very nice. Thanks! Greetings from Vienna --- Yassine ELassad [EMAIL PROTECTED] wrote: hi i'm not sure if this will help you but i have hade a quite similar issue : i have passed a full URL a param Vlaue in my web.xml something like http://localhost:8080/MyServlet both http and :8080 are specifying a differnt port number than the ssl port so if you are performing such a call you better change it into /MyServlet/ and the servlet conatainer handels everythings else for you i hope this helps Greeting from Cologne YEL directBOX Reply --- From: RaueberHotzenplotz ([EMAIL PROTECTED]) To: tomcat-user@jakarta.apache.org Date: 04.10.2005 17:55:03 Hi I've got a servlet which works fine when using http. But when I want to access it through https I get a certificate unknown exception. Why does https://localhost:8443 work in a browser but accessing my servlet (with java client) not? Do I need to make my servlet SSL aware? Using another secure webserver works with my client. Hope someone can help. Thanks! ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Verpassen Sie keine eBay-Auktion und bieten Sie bequem und schnell über das Telefon mit http://www.telefonbieten.de Ihre eMails auf dem Handy lesen - ohne Zeitverlust - 24h/Tag eMail, FAX, SMS, VoiceMail mit http://www.directbox.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SSL question
Hi I've got a servlet which works fine when using http. But when I want to access it through https I get a certificate unknown exception. Why does https://localhost:8443 work in a browser but accessing my servlet (with java client) not? Do I need to make my servlet SSL aware? Using another secure webserver works with my client. Hope someone can help. Thanks! ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Rép. : SSL question
Hi, thanks! I've got my own TrustManager/HostnameVerifier and it works when I use Apache's SecureWebServer and SecureXmlRpcClient. I'm not using javax.net.ssl, but instead com.sun.net.ssl - couldn't make it work with javax.net.ssl. Is the code below necessary for the servlet as well? Thought Tomcat has got all the information about trusted certificates in its keystore. --- Antony GUILLOTEAU [EMAIL PROTECTED] wrote: Many articles talk about how access https using java client throws HttpsURLConnection. You must use : - your own TrustManager (implements javax.net.ssl.X509TrustManager) - your own KeyManager (implements javax.net.ssl.X509KeyManager) - your own HostnameVerifer(implements javax.net.ssl.HostnameVerifer) and use this following code : TrustManager[] objTrustManager = new TrustManager[] {new MyX509TrustManager()}; KeyManager[] objKeyManager = new KeyManager[] {new MyX509KeyManager()}; SSLContext sc = SSLContext.getInstance(SSL); sc.init(objKeyManager, objTrustManager, new SecureRandom()); SSLSocketFactory objSocketFactory = sc.getSocketFactory(); HttpsURLConnection.setDefaultSSLSocketFactory(objSocketFactory); HttpsURLConnection.setDefaultHostnameVerifier(new MyHostnameVerifer()); ... URL objUrl = new URL(...) HttpsURLConnection objHttpsURLConnection = (javax.net.ssl.HttpsURLConnection) objUrl.openConnection(); I hope it's help you. [EMAIL PROTECTED] 04/10/2005 17:54:30 Hi I've got a servlet which works fine when using http. But when I want to access it through https I get a certificate unknown exception. Why does https://localhost:8443 work in a browser but accessing my servlet (with java client) not? Do I need to make my servlet SSL aware? Using another secure webserver works with my client. Hope someone can help. Thanks! ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat + SSL problems!
Hello I need my client to communicate with a servlet using secure xmlrpc. Using Apache's SecureWebServer works (got my own TrustManager, HostnameVerifier, selfsigned certificates/keystores for server/client). Accessing Tomcat with a browser (https://localhost:8443) works too (selfsigned certificate/keystore for tomcat). But when I try to make a secure XMLRPC call to the servlet (https://localhost:8443/myservlets/myservlet), I just get a certificate unknown exception. When adding the selfsigned Tomcat certificate to $JAVA_HOME/jre/lib/security/cacerts, I get this: java.io.IOException: HTTPS hostname wrong: should be localhost. I guess Tomcat does not know of my certificate. With the SecureWebServer/SecureXmlRpcClient implemenation I use an open (trust anyone) TrustManager, HostnameVerifier. What do I need to do? Thanks! ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What's better, having one large servlet or many small ones?
Hello Should I have one handler with many methods or more handlers with less methods (1-2)? Thanks! ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Simple XML RPC Servlet does not work - assuming address problem
Hi This simple Servlet works (address: http://localhost:8080/testapp/testservlet): public class Server extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { PrintWriter out = res.getWriter(); out.println(Hello, you!); out.close(); } } I'm using an ant script that creates testapp.war and deploys it. my web.xml: ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 servlet servlet-nameTestServlet/servlet-name servlet-classtestpackage.TestServlet/servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/testservlet/url-pattern /servlet-mapping /web-app However, my simple Xml Rpc application doesn't. If my client makes a Xml Rpc call on address http://localhost:8080/testapp/testservlet, I get the error: Exception in thread main java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/testapp/testservlet Code: public class Server extends HttpServlet { public void doPost (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { XmlRpcServer xmlrpc = new XmlRpcServer(); xmlrpc.addHandler (testHandler, new TestHandler()); byte[] result = xmlrpc.execute(req.getInputStream()); res.setContentType(text/xml); res.setContentLength(result.length); OutputStream out = res.getOutputStream(); out.write (result); out.flush (); } } public class TestClient { public static void main(String[] args) throws XmlRpcException, IOException { XmlRpcClient xmlrpc = new XmlRpcClient (http://localhost:8080/testapp/testservlet;); Vector params = new Vector (); params.addElement (hello world); // this method returns a string String result = (String) xmlrpc.execute(testHandler.hello, params); System.out.println(result); } } public class TestHandler implements Serializable { public String hello(String input) { return input; } } ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Want to run servlets from other directory than webapps
Hi I've got Tomcat-5.0.27-r5 installed. Running servlets (localhost) located in /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no problem. What do I need to do to run servlets from my user directory (e.g. /home/user/myapp)? I've tried to use http://localhost:8080/admin to add an additional context, setting path and docbase to /home/user/myapp, but this doesn't work. I've also tried to change appbase to /home/user/myapp in conf/server.xml, but again no success. I've uncommented the 'invoker' lines in conf/web.xml - for the moment anyway: servlet servlet-nameinvoker/servlet-name servlet-class org.apache.catalina.servlets.InvokerServlet /servlet-class init-param param-namedebug/param-name param-value0/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping How do you configure Tomcat? Do you use the admin tool or do you do it manually? The admin tool works strange e.g. after deleting some context it was still in the list. Thanks! Regards, Rudi ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Want to run servlets from other directory than webapps
I'm running Tomcat as standalone server at the moment - that could change later on. What's the preferred way in Tomcat 5? Thanks! --- Oto Bossert [EMAIL PROTECTED] wrote: Yoo, Do you use tomcat stand-alone? Or with Apache Putting a context in server.xml should work, but this is not the prevered way in tomcat 5! Greetings O. On 5/11/05, Raueber Hotzenplotz [EMAIL PROTECTED] wrote: Hi I've got Tomcat-5.0.27-r5 installed. Running servlets (localhost) located in /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no problem. What do I need to do to run servlets from my user directory (e.g. /home/user/myapp)? I've tried to use http://localhost:8080/admin to add an additional context, setting path and docbase to /home/user/myapp, but this doesn't work. I've also tried to change appbase to /home/user/myapp in conf/server.xml, but again no success. I've uncommented the 'invoker' lines in conf/web.xml - for the moment anyway: servlet servlet-nameinvoker/servlet-name servlet-class org.apache.catalina.servlets.InvokerServlet /servlet-class init-param param-namedebug/param-name param-value0/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping How do you configure Tomcat? Do you use the admin tool or do you do it manually? The admin tool works strange e.g. after deleting some context it was still in the list. Thanks! Regards, Rudi ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Want to run servlets from other directory than webapps
Thanks PST! Will try it out tomorrow. Rudi --- Patrick Thomas [EMAIL PROTECTED] wrote: Hi Rudi, Here's how I do it, and this also seems to be the 'correct' way of doing it with Tomcat5 (as it doesn't mean messing with any container-level files). Into {tomcathome}\conf\Catalina\localhost\ I place a correctly formed context file, for example ApplicationName.xml (very minimal for demonstration purposes... you could, of course, make it do whatever a normal context file would). ApplicationName.xml - ?xml version=1.0 encoding=UTF-8? Context path=/ApplicationName docBase=C:/share/ApplicationCode/ debug=1 reloadable=true /Context --- End ApplicationName.xml The C:/share/ApplicationCode/ directory would contain the JSPs, the META-INF dir, the WEB-INF dir, etc. Restart your tomcat Server and away you go. You can even use the admin utility to tweak it. Cheers, PST On 5/11/05, Raueber Hotzenplotz [EMAIL PROTECTED] wrote: Hi I've got Tomcat-5.0.27-r5 installed. Running servlets (localhost) located in /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no problem. What do I need to do to run servlets from my user directory (e.g. /home/user/myapp)? I've tried to use http://localhost:8080/admin to add an additional context, setting path and docbase to /home/user/myapp, but this doesn't work. I've also tried to change appbase to /home/user/myapp in conf/server.xml, but again no success. I've uncommented the 'invoker' lines in conf/web.xml - for the moment anyway: servlet servlet-nameinvoker/servlet-name servlet-class org.apache.catalina.servlets.InvokerServlet /servlet-class init-param param-namedebug/param-name param-value0/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping How do you configure Tomcat? Do you use the admin tool or do you do it manually? The admin tool works strange e.g. after deleting some context it was still in the list. Thanks! Regards, Rudi ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Does your mail provider give you FREE antivirus protection? Get Yahoo! Mail http://uk.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]