473,324 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Determining if a Server Supports SSL

I've got a simple problem. Currently, I have a .Config setting called
SupportsSSL that I use within an ASP.NET web application to determine
whether I redirect to an HTTP or HTTPS connection (for instance, when the
user visits the Login page). I'm wondering if there is a programatic way to
determine this instead of keeping track of different Machine.Config settings
on different machines...?

What I'm really striving for is that for our Production web servers, we've
got the SSL certificates setup, and on our development servcers, we don't.
Therefore I need to redirect slightly differently on the two different farms
in order to avoid "Cannot Find Server" errors when trying to hit an HTTPS
url on an development machine.

Any ideas would be appreciated.

Thanks,
Chris
Nov 17 '05 #1
4 1007
Why don't you just install certificates on your development box like
everybody else? Any certificate will do (even your production one), you'll
just have to live with the browser complaining unless you want to pay for a
trusted certificate or create and install your own CA certificate.

Jerry

"Christopher D. Wiederspan" <wi********@netquote.com> wrote in message
news:e3**************@TK2MSFTNGP10.phx.gbl...
I've got a simple problem. Currently, I have a .Config setting called
SupportsSSL that I use within an ASP.NET web application to determine
whether I redirect to an HTTP or HTTPS connection (for instance, when the
user visits the Login page). I'm wondering if there is a programatic way to determine this instead of keeping track of different Machine.Config settings on different machines...?

What I'm really striving for is that for our Production web servers, we've
got the SSL certificates setup, and on our development servcers, we don't.
Therefore I need to redirect slightly differently on the two different farms in order to avoid "Cannot Find Server" errors when trying to hit an HTTPS
url on an development machine.

Any ideas would be appreciated.

Thanks,
Chris

Nov 17 '05 #2
Why don't you just install certificates on your development box like
everybody else? Any certificate will do (even your production one), you'll
just have to live with the browser complaining unless you want to pay for a
trusted certificate or create and install your own CA certificate.

Jerry

"Christopher D. Wiederspan" <wi********@netquote.com> wrote in message
news:e3**************@TK2MSFTNGP10.phx.gbl...
I've got a simple problem. Currently, I have a .Config setting called
SupportsSSL that I use within an ASP.NET web application to determine
whether I redirect to an HTTP or HTTPS connection (for instance, when the
user visits the Login page). I'm wondering if there is a programatic way to determine this instead of keeping track of different Machine.Config settings on different machines...?

What I'm really striving for is that for our Production web servers, we've
got the SSL certificates setup, and on our development servcers, we don't.
Therefore I need to redirect slightly differently on the two different farms in order to avoid "Cannot Find Server" errors when trying to hit an HTTPS
url on an development machine.

Any ideas would be appreciated.

Thanks,
Chris

Nov 17 '05 #3
Hi Chris,

Based on my research and experience, we can first try to make an HTTPS
connect to the web server before taking any further action. If the web
server doesn't support SSL, an error should be returned. Here is the sample
code (VB.NET):

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Initialize the WebRequest.
Dim myRequest As WebRequest =
WebRequest.Create("https://www.microsoft.com")

Try
' Return the response.
Dim myResponse As WebResponse = myRequest.GetResponse()

' Code to use the WebResponse goes here.
' Close the response to free resources.
myResponse.Close()
Catch ex As WebException
Response.Write(ex.Message)
End Try
End Sub

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #4
Hi Chris,

Based on my research and experience, we can first try to make an HTTPS
connect to the web server before taking any further action. If the web
server doesn't support SSL, an error should be returned. Here is the sample
code (VB.NET):

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Initialize the WebRequest.
Dim myRequest As WebRequest =
WebRequest.Create("https://www.microsoft.com")

Try
' Return the response.
Dim myResponse As WebResponse = myRequest.GetResponse()

' Code to use the WebResponse goes here.
' Close the response to free resources.
myResponse.Close()
Catch ex As WebException
Response.Write(ex.Message)
End Try
End Sub

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: DartmanX | last post by:
Is there a simple way to determine if someone using Internet Explorer has completely disabled ActiveX controls? Jason
0
by: Christopher D. Wiederspan | last post by:
I've got a simple problem. Currently, I have a .Config setting called SupportsSSL that I use within an ASP.NET web application to determine whether I redirect to an HTTP or HTTPS connection (for...
4
by: Rémi | last post by:
Question: How can you determine the character set used by a webpage you built? My understanding of the issue is that the character set used by an HTML file (or any other file, for that matter)...
38
Frinavale
by: Frinavale | last post by:
I'm implementing a Silverlight application that uses Sockets to receive data that is pushed to it from a Socket Server. (Silverlight only supports the TCP protocol) The Socket Server pushes a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.