all groups > inetserver asp components > may 2004 >
You're in the

inetserver asp components

group:

IIS Server domain name or assigned IP adress


IIS Server domain name or assigned IP adress Ladislav Kepl
5/28/2004 4:07:16 PM
inetserver asp components:
Hallo,
I have five NIC on one w2k3 server where is running five webs, each of them
has assigned own IP address from NIC. I have one old COM component which is
connecting to SQL server. Now I need to recognize which web root was created
instance of com object and depeneding on this result have to connect to
specified SQL server. Can somebody advise me how to recognize assined IP
adress in ASP or by some API function? Each web site have assigned
certificate to serve pages via SSL. Is there some function to resolve
domain name from assigned certificate?
Thanks
LK

Re: IIS Server domain name or assigned IP adress Ben Miller [MSFT]
6/1/2004 10:12:16 PM
You can find out the IP address from the NIC serving the request by using
Request.ServerVariables("LOCAL_ADDR").

You can find out the domain by using the
Request.ServerVariables("SERVER_NAME")

For HTTPS stuff...

in Request.ServerVariables you will find the following. In the
HTTPS_SERVER_SUBJECT you will find the CN=
HTTPS = on
HTTPS_KEYSIZE = 128
HTTPS_SECRETKEYSIZE = 1024
HTTPS_SERVER_ISSUER = C=ZA, S=Western Cape, L=Cape Town, O=Thawte Consulting
cc, OU=Certification Services Division, CN=Thawte Server CA,
E=server-certs@thawte.com
HTTPS_SERVER_SUBJECT = C=US, S=California, L=City, O=Company Formal Name,
OU=secure.com, CN=shopping.secure.com

HTH.

Ben Miller

--
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.



[quoted text, click to view]

AddThis Social Bookmark Button