1

Hope my question is clear!

I have created a WCF Service and have implemented all necessary work for SSL implementation. From IIS to Web.config

I am able to accessing Service with following URL successfully on browser from my own PC.

https://mycomputername/wcfService.svc

but How can I access it using my IP-Address e.g:

https://192.x.x.x/wcfService.svc

Actually I have to access the web service from another PC with in my network.

KumailR
  • 505
  • 1
  • 4
  • 20
  • What happens when you try to access using IP address? – Rahul Oct 15 '14 at 11:15
  • If its within your network and your other PC has access to it then just find the local ip adress of that PC. Go into cmd and write ipconfig its the IPv4 Address line – Vajura Oct 15 '14 at 11:15
  • @rahul it resulting nothing, browser page remains in loading state as I remove the SSL binding from IIS I can access it using "http:" with my IP address. – KumailR Oct 15 '14 at 11:34

1 Answers1

2

The SSL certificate will be associated with a domain name, not with an IP address.

So you will have to customize how to accept the SSL certificate. If you have a .NET client, you can use ServicePointManager.ServerCertificateValidationCallback and return true to accept any certificate.

Related: How to ignore the certificate check when ssl

Community
  • 1
  • 1
vtortola
  • 34,709
  • 29
  • 161
  • 263
  • thanks @vtorla, your first line is enough for my query. but I want further detail; coz I am not consuming the wcf service in another .net application. As I can access it via 'computername' in the URL from my pc browser, is there a way that I can open it from browser of another pc? – KumailR Oct 15 '14 at 11:30
  • You can add a host entry in your HOSTS file, so that domain name points to your desired IP address rather than the real one: http://www.tomshardware.co.uk/faq/id-1821155/edit-hosts-file-windows.html – vtortola Oct 15 '14 at 11:32
  • it comes in my mind, but it will not work as service with ssl is not accessable using IP-Address. – KumailR Oct 15 '14 at 11:39
  • Well, this is the point of having a SSL certificate, to validate you are connecting to the right place (not only transport security), so if you want to "tamper" the server location... it needs a little bit of work :D The client default validation will need to match the server certificate and domain name. – vtortola Oct 15 '14 at 11:43