Re: Query on Tomcat Server.xml

2009-09-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bhuvanesh,

On 9/7/2009 12:00 AM, Pattanashetti wrote:
> I wanted to create connector using tomcat Apis.
> 
> Connector conn = new Connector();
> conn.setPort(8070);
> 
> service.addConnector(conn);
> 
> This above code is working fine. I m able to access the appication with this
> connector port (8070).
> 
> *But i wanted to configure the Https port in the same manner. *
> 
> Connector class does not have* setKeyStoreFile* of 
> *setKeyStorePassword*method.
> 
> I tried with connector.setAttribute("keystoreFile", filePath);
> 
> But this is not working. :(
> 
> Is there any specific way to for creating https connector using tomcat APIs?

I'm not going to read the APIs for you, you can read them yourself:
http://tomcat.apache.org/tomcat-6.0-doc/api/index.html

Specifically, I would look at the packages org.apache.catalina.connector
and org.apache.coyote.http11.

It would also help to look at the code Tomcat uses to build its own
connector objects in the org/apache/catalina/startup/Catalina.java and
org/apache/catalina/startup/ConnectorCreateRule.java files.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqpMrYACgkQ9CaO5/Lv0PC/pwCdEqd/onAuTnLKGnFjJQ9xi9yZ
5cMAoIG57tFJiGK//QOKXW6bpxnwBRde
=GuTF
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Query on Tomcat Server.xml

2009-09-06 Thread Bhuvanesh Pattanashetti
Hello chris,

Thanks for your suggestions,
this is service injected spring dM(spring and OSGI combination). This is
same  tag present in server.xml , injected by spingdM in object
format(instance of ). SpringDm or Spring does not support connector for
tomcat.

I wanted to create connector using tomcat Apis.

Connector conn = new Connector();
conn.setPort(8070);

service.addConnector(conn);

This above code is working fine. I m able to access the appication with this
connector port (8070).

*But i wanted to configure the Https port in the same manner. *

Connector class does not have* setKeyStoreFile* of *setKeyStorePassword*method.

I tried with connector.setAttribute("keystoreFile", filePath);

But this is not working. :(

Is there any specific way to for creating https connector using tomcat APIs?

Thanks,
Bhuvan P



On Fri, Sep 4, 2009 at 2:29 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Bhuvan,
>
> On 9/2/2009 1:44 AM, Bhuvanesh Pattanashetti wrote:
> > Thanks for your suggestion,
> > I wanted only some part of tomcat to be customized.So it would be risky
> and
> > time consuming if i override the whole part.
> >
> > I have reached some extent.
> >
> > i m using spring-DM running on tomcat. Spring-DM is able to inject
> > the  object my business class.
>
> Wait... are you trying to have Spring inject Tomcat's Service object
> into one of your own classes? I suspect you're getting a worthless
> Service object (that is, one created from scratch that has nothing to do
> with the currently-running Tomcat).
>
> > I wanted to add https port(Http11NioProtocol connector element) to
> > this  through coding.
>
> If you're using Spring, and you already have a Service object, why not
> just have Spring create a Http11NioConnector object and attach it to
> that service?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkqgLh0ACgkQ9CaO5/Lv0PCGJwCghScN9K9OyQ4hI5yYZmeHJV6N
> YyUAn0AOSBst6R05W+sevQCDTcyUI3Lh
> =01Mq
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Query on Tomcat Server.xml

2009-09-03 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bhuvan,

On 9/2/2009 1:44 AM, Bhuvanesh Pattanashetti wrote:
> Thanks for your suggestion,
> I wanted only some part of tomcat to be customized.So it would be risky and
> time consuming if i override the whole part.
> 
> I have reached some extent.
> 
> i m using spring-DM running on tomcat. Spring-DM is able to inject
> the  object my business class.

Wait... are you trying to have Spring inject Tomcat's Service object
into one of your own classes? I suspect you're getting a worthless
Service object (that is, one created from scratch that has nothing to do
with the currently-running Tomcat).

> I wanted to add https port(Http11NioProtocol connector element) to
> this  through coding.

If you're using Spring, and you already have a Service object, why not
just have Spring create a Http11NioConnector object and attach it to
that service?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqgLh0ACgkQ9CaO5/Lv0PCGJwCghScN9K9OyQ4hI5yYZmeHJV6N
YyUAn0AOSBst6R05W+sevQCDTcyUI3Lh
=01Mq
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Query on Tomcat Server.xml

2009-09-01 Thread Bhuvanesh Pattanashetti
Thanks for your suggestion,
I wanted only some part of tomcat to be customized.So it would be risky and
time consuming if i override the whole part.

I have reached some extent.

i m using spring-DM running on tomcat. Spring-DM is able to inject
the  object my business class.


I wanted to add https port(Http11NioProtocol connector element) to
this  through coding.

can u suggest me what is best way to do that.

thanks,
Bhuvan


On Tue, Sep 1, 2009 at 8:42 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Bhuvan,
>
> On 8/31/2009 11:46 PM, Bhuvanesh Pattanashetti wrote:
> > Hi, Even i have similar problem..
> > I wanted to create the  element. At the time of tomcat start
> up
> > using Tomcat's existing bootstrap classes rather than loading them using
> > sever.xml.
> > I wanted to create a https connector. using Http11NioProtocol for the
> > connector.
> >
> > Please let me know if any documentation is available on that? or any body
> > who has implemented the similar ones...
>
> http://www.google.com/search?q=how+to+embed+tomcat
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkqdOcsACgkQ9CaO5/Lv0PBpuQCcC6S3Oa0CSJl/U+RQAAqviy75
> 1ocAn0JaLFPyJre9jgK+oy6Dj3mg3s6s
> =6SKq
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Query on Tomcat Server.xml

2009-09-01 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bhuvan,

On 8/31/2009 11:46 PM, Bhuvanesh Pattanashetti wrote:
> Hi, Even i have similar problem..
> I wanted to create the  element. At the time of tomcat start up
> using Tomcat's existing bootstrap classes rather than loading them using
> sever.xml.
> I wanted to create a https connector. using Http11NioProtocol for the
> connector.
> 
> Please let me know if any documentation is available on that? or any body
> who has implemented the similar ones...

http://www.google.com/search?q=how+to+embed+tomcat

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqdOcsACgkQ9CaO5/Lv0PBpuQCcC6S3Oa0CSJl/U+RQAAqviy75
1ocAn0JaLFPyJre9jgK+oy6Dj3mg3s6s
=6SKq
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Query on Tomcat Server.xml

2009-08-31 Thread Bhuvanesh Pattanashetti
Hi, Even i have similar problem..
I wanted to create the  element. At the time of tomcat start up
using Tomcat's existing bootstrap classes rather than loading them using
sever.xml.
I wanted to create a https connector. using Http11NioProtocol for the
connector.

Please let me know if any documentation is available on that? or any body
who has implemented the similar ones...

Thanks..
Bhuvan





On Mon, Aug 31, 2009 at 8:21 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Pramod,
>
> On 8/31/2009 7:19 AM, Tk, Pramod (NSN - IN/Bangalore) wrote:
> > What I want to make is to remove keystorePass="X" tag and give
> > this keystore password when tomcat starts up.
>
> I think you'll have to write your own code that reads the keystore
> password from the console (and displays it, since I don't think Java can
> control a pty device very well) and then sets up Tomcat. If you're
> trying to be cute, you could pop-up a tiny GUI window to get the
> password, but that will significantly increase the amount of memory
> required just to get Tomcat started because the GUI subsystem must be
> started.
>
> Or, you could hack Tomcat's existing bootstrap classes to do the same
> thing, but it might end up being more complicated than you think
> (because IIRC Tomcat uses commons-digester to configure everything).
>
> In either case, you'll have to figure out how to get Tomcat into the
> background after accepting the password, too, unless you just expect
> users to press CTLR-Z and then type "bg" or whatever.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkqb42AACgkQ9CaO5/Lv0PBI3QCdHFh4oSYRuRtbjrnb5xp4OMCO
> wuUAnijsqsTyNrw5I7VKWFIzOxKt/+HU
> =oFqy
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Query on Tomcat Server.xml

2009-08-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pramod,

On 8/31/2009 7:19 AM, Tk, Pramod (NSN - IN/Bangalore) wrote:
> What I want to make is to remove keystorePass="X" tag and give
> this keystore password when tomcat starts up. 

I think you'll have to write your own code that reads the keystore
password from the console (and displays it, since I don't think Java can
control a pty device very well) and then sets up Tomcat. If you're
trying to be cute, you could pop-up a tiny GUI window to get the
password, but that will significantly increase the amount of memory
required just to get Tomcat started because the GUI subsystem must be
started.

Or, you could hack Tomcat's existing bootstrap classes to do the same
thing, but it might end up being more complicated than you think
(because IIRC Tomcat uses commons-digester to configure everything).

In either case, you'll have to figure out how to get Tomcat into the
background after accepting the password, too, unless you just expect
users to press CTLR-Z and then type "bg" or whatever.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqb42AACgkQ9CaO5/Lv0PBI3QCdHFh4oSYRuRtbjrnb5xp4OMCO
wuUAnijsqsTyNrw5I7VKWFIzOxKt/+HU
=oFqy
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Query on Tomcat Server.xml

2009-08-31 Thread Mikolaj Rydzewski

Caldarale, Charles R wrote:

Not really.

If you don't put the password in server.xml, where are you going to put it?  
The server.xml file can have the same access constraints applied to it as any 
other location for the password.
  
I think that OP wants Tomcat to read keystore during startup and then 
pull out smart card from computer.


--
Mikolaj Rydzewski 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Query on Tomcat Server.xml

2009-08-31 Thread Caldarale, Charles R
> From: Tk, Pramod (NSN - IN/Bangalore) [mailto:pramod...@nsn.com]
> Subject: Query on Tomcat Server.xml
> 
> I presume this type of hardcoding in server.xml is security loop hole.

Not really.

If you don't put the password in server.xml, where are you going to put it?  
The server.xml file can have the same access constraints applied to it as any 
other location for the password.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Query on Tomcat Server.xml

2009-08-31 Thread Tk, Pramod (NSN - IN/Bangalore)
Hello All,

 

The below tag is used to for making use of keystore on snmartcard. It
works fine

 



But ,

 

What I want to make is to remove keystorePass="X" tag and give
this keystore password when tomcat starts up. 

 

I presume this type of hardcoding in server.xml is security loop hole.  

 

Apache asks keystore password during its start up.

 

Any suggestions to avoid the hard coding  of the password in tomcat will
appreciated.

 

 

Thanks :-),

Pramod TK