Thursday, December 16, 2010

Internet Information Server returns IP address in HTTP header

Note:- This procedure is applicable to IIS6 Only It is tested, but test in Test Environment B4 going on to Prod Server.set the name that you want to display it can be PublicIP/AnySiteName by using the Param SetHostName as shown below, with the command results.

CMD:cscript.exe adsutil.vbs set w3svc/1/SetHostName www.MyTestSite.com
CMD:-Results are mentioned below







Above results can be cross checked or verified by using either HTTP HEAD Params or directly by trying the below script, and belive me it will not reveil the Server Private IP thro/over the Internet
No need to stop start the IIS Server also.


CMD:-cscript adsutil.vbs enum /w3svc/1
CMD:-Results are mentioned below













































The other useful info is like /w3svc/1 where 1 is the siteid and if more then 1 site are deployed on to your server then by appending that siteid details about the same can be viewed.
Here 1 is the SiteID for the Default web site for Windows IIS server.
CMD:- cscript adsutil.vbs enum w3svc/SiteID

And apart from all this stuff the simplest way to hide your server information thro' the Http Header is to stop the Default WebSite or Do Not Host your website with the Default Site always create a new site with minimal requirements.

Server certificate rejected by ChainVerifier (SSL Error with TIBCO BW 5.3)

An IOException was thrown while trying to execute the Http method caused by: java.io.IOException: Failed to create secure client socket: Server certificate rejected by ChainVerifier

Simple Steps to make your TOMCAT Run on HTTPS using KEYTOOL utility

1). keytool -genkey -alias www.mytest.com -keyalg RSA -keysize 2048 -keystore www_mytest_com.jks

2). keytool -certreq -alias www.mytest.com -file www_mytest_com.csr -keystore www_mytest_com.jks

3). keytool -import -trustcacerts -alias www.mytest.com -file D:\www_mytest_com.p7b -keystore www_mytest_com.jks
This will install Certificate and the Root Certificate associated with the same., sometimes this will not work and in that case try the below steps.

3.1). keytool -import -alias www.mytest.com -file D:\www_mytest_com.cer -keystore www_mytest_com.jks
3.2). keytool -import -trustcacerts -file D:\www_mytest_com_root.cer -keystore www_mytest_com.jks

4). Modify server.xml and Restart TOMCAT SERVER
 <Connector port="443" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true"
    acceptCount="100" scheme="https" secure="true"
    clientAuth="false" keyAlias="www.mytest.com"
    keystoreFile="C:\Program Files\Java\jre6\bin\www_mytest_com.jks"
    keypass="changeit"/>

**Note: By default Tomcat will look for your Keystore with the file name .keystore in the home directory with the default password changeit. The home directory is generally /home/user_name/ on Unix and Linux systems, and C:\Documents and Settings\user_name\ on Microsoft Windows systems

**TIBCO Admin Console needs certificate in PEM format and here is the method to export your CERT into PEM

exportcert - This option is available with JRE-1.6 if u r using JRE-1.5 then simply try export option and it will export the cert into the PEM format.

keytool -exportcert -alias www.mytest.com -keypass changeit -keystore www_mytest_com.jks -rfc -file keytool_www_mytest_com.pem -storepass changeit

Useful links @ Tibco SSL Certificates
http://www.tibcommunity.com/docs/DOC-2178
http://www.tibcommunity.com/docs/DOC-2195