473,396 Members | 1,915 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,396 software developers and data experts.

detect https

SJ
How would I detect if a server is running securely (https) or not?
-SJ
Nov 20 '05 #1
6 5337
Request.ServerVariables("HTTPS")


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"SJ" <my******@sbcglobal.net> wrote in message
news:wa******************@newssvr21.news.prodigy.c om...
How would I detect if a server is running securely (https) or not?
-SJ

Nov 20 '05 #2
Hi,
How would I detect if a server is running securely (https) or not?


Try

If Request.Url.Scheme.Equals("https") Then
' Is secure...
End If

A better approach would be to restrict the access to the application by
IIS, which allows to force the use of SSL. In this case you won't have
to check programmatically.

--
Karsten Samaschke
IT-Consulting, IT-Development, IT-Training
5x MS MVP ASP / ASP.NET, Germany
Homepage: http://www.ksamaschke.de
- - - - - - - - - - - - - - - - - - - - - - - - - -
My Weblog: http://www.karsan.de
My Books: http://books.ksamaschke.de
Nov 20 '05 #3
SJ
Thankyou.
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eF**************@TK2MSFTNGP15.phx.gbl...
Request.ServerVariables("HTTPS")


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"SJ" <my******@sbcglobal.net> wrote in message
news:wa******************@newssvr21.news.prodigy.c om...
How would I detect if a server is running securely (https) or not?
-SJ


Nov 20 '05 #4
Juan T. Llibre wrote:
Request.ServerVariables("HTTPS")


That's only half the truth. You need to check for the value "on" as
well. But this is really just an awkward way of saying

Request.IsSecureConnection

;-)

--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 20 '05 #5
re:
Request.IsSecureConnection
That's only half the truth.
You need to check for the value "true" as well.

;-)


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:xn****************@msnews.microsoft.com... Juan T. Llibre wrote:
Request.ServerVariables("HTTPS")

That's only half the truth. You need to check for the value "on" as
well. But this is really just an awkward way of saying

Request.IsSecureConnection

;-)

Nov 20 '05 #6
Juan T. Llibre wrote:
re:
Request.IsSecureConnection


That's only half the truth.
You need to check for the value "true" as well.

;-)


LOL!
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 20 '05 #7

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

Similar topics

2
by: Craig Keightley | last post by:
i have the following script on my checkout page to check if https is set in the address bar: if ($_SERVER != "on") { $url = $_SERVER; $query = $_SERVER; $path = $_SERVER; header("Location:...
2
by: ChrisJ | last post by:
I need to include some javascript in my pages to display a "trusted" logo. I need one script if its an https page and a different one if its an http page. All the pages are created dynamically by...
14
by: Peter Chant | last post by:
I'm currently authenticating a site I have built using basic http authentication built into apache. This has zero overhead on php which is a bonus but it seems to not quite work how I'd like. ...
4
by: Jason P | last post by:
Basically we have a web method with a dynamic URL. The client is developed in C++ and I've been using the webReference.SetUrl( "http://test.example.com..." ) method successfully with various web...
9
by: VK | last post by:
if ((window)&&(window.netscape)&&(window.netscape.security)) { // OK, this is Gecko/Firefox or someone mimicing it so well // that there is no way to catch it on the act. } But I need Firefox...
4
by: Uldis Bojars | last post by:
Hi! How can Javascript code detect if a user has been authenticated to see a page, that is, if he has entered a username and password for HTTP authentification to see the current page. Possibly...
12
by: Phil | last post by:
I can check for MdiChildren.Length=0, but which event handler should I put this in to detect when a child window is closed? TIA Phil.
1
stepterr
by: stepterr | last post by:
Hi All, Does anyone know if it is possible to detect if a user has SSL enabled in their browser? I have a login page that is https but if the user does not have SSL enabled it of course just gives...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.