Hi,
I am trying to post form values to a https web page programmaticall y
using Httpwebrequest but no matter what I do the same login page is
returned instead of the next page. I would very much appreciate if
someone could show me what is it that I am doing wrong. Below is the
code that I am using. -
Imports System.IO
-
Imports System.Net
-
Imports System.Net.Security
-
Imports System.Security.Cryptography.X509Certificates
-
-
Public Class Form1
-
-
Private Function ValidateCertificate(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
-
If certificate.Issuer.Contains("OU=Diadora") Then
-
Return True
-
Else
-
Return False
-
End If
-
End Function
-
-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
-
ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateCertificate)
-
-
Dim Req As HttpWebRequest
-
'Dim SourceStream As System.IO.Stream
-
Dim Response As HttpWebResponse
-
-
'-- get file
-
Dim URL2 As String = "https://mysite.com:8443/filelist/library.htm?o_id=2"
-
Req = HttpWebRequest.Create(URL2)
-
Req.Credentials = New NetworkCredential("admin", "password")
-
Req.AllowAutoRedirect = False
-
Response = Req.GetResponse()
-
Dim sr2 As IO.StreamReader = New IO.StreamReader(Req.GetResponse.GetResponseStream)
-
'-- check responser, and make sure you are logged in
-
Dim html_data As String = sr2.ReadToEnd
-
Console.WriteLine(sr2.ReadToEnd)
-
Response.Close()
-
-
End Sub
-
-
-
-
End Class
3 1929
Check out if the framework's default certificate policy works for you. If not, you need to implement your own: ServicePointMan ager.Certificat ePolicy Property
Hi,
CertificatePoli cy is obsoleted for this type, that is why I am using ServerCertifica teValidationCal lback. But SSL acceptance is not my issue, I am already bypassing this. My problem is that no matter what I do, I never get passed the Log In page.
Plater 7,872
Recognized Expert Expert
Have you used a packet watcher to make sure the data you submit via HttpWebRequest is the same as the data you submit via a regular client browser? All cookies, and session header objects in place?
Also, do you not still need to set the HttpWebRequest object to use https? I am pretty sure it ignores it if you don't
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Terence Parker |
last post by:
I am trying to connect an e-commerce system to a payment gateway (located in
Hong Kong). The gateway takes values in the form of a simple form submit -
however, the results (i.e. authorisation code, status, etc...) are not
returned to a separate HTML page (I am not given the option of defining a
resulting HTML page to which the results are sent) - but rather I must
receive them within the same page through a data stream somehow.
Does...
|
by: wk6pack |
last post by:
Hi,
I have a problem and not quite how to go about solving it.
I have a form written in asp. I wish to submit the form and have the server
return back to the same page without actually refreshing the page.
I know I could write a form, submit it and go to another page.
I've searched the web and I see something about HTTP Status code of 204
|
by: Hugo Botha |
last post by:
Hi,
I have created 2 asp pages called testa.asp and testb.asp
testa.asp has a link to go to next page testb.asp
testb.asp has a form that ask you for a reference number and post it
to the same page testb.asp
If the reference number is not blank, it will just write out what the
|
by: Bjorn |
last post by:
Hi,
I need to submit in the same page two forms to two different ASP-pages.
I created two forms, each with hidden input and a submit button. But it
doesn't work. Nothing happens with the second form.
Does it exist a way to do that?
Thanks
bjorn
|
by: DotNetGruven |
last post by:
I've got a page that does a search... There is an ImageButton on it that
allows the user to reset the search.
The Click Handler for the button clears out the Data and then redirects to
the same page with Response.Redirect("Search.Aspx", true);
Sometimes the code in Page_Load within the IsPostBack part of the if
statement runs and sometimes it doesn't. IN other words, sometimes
IsPostBack is true and sometimes it is not!
| |
by: Pete |
last post by:
Hi all...
I sincerly hope one of the MS guys can clear this up for me...
First some background...
Ok, I have a web site which is fully translatable into several
languages. All the strings for the web site are held in a database and
all the labels, buttons etc are populated at run time in the Page_Load
handler. The retreval of the strings from the database is all
|
by: Stimp |
last post by:
I have a login page on a Windows IIS server: login.aspx
I'd like to enable the user to optionally use HTTPS to login
so that their password would not be easily snooped out.
What does this involve exactly?
I know that you use a https prefix instead of http, but that's it.
Is there configuration of directories necessary?
Got a good website for this basic info on https?
|
by: Randall Parker |
last post by:
1) What sorts of scenarios make the possibility of sniffing out a password a higher risk?
2) Do packets travel unencrypted over 802.11 wireless? Is it easy to sniff such
packets and catch a submit of a logon web page using http? Wireless strikes me as the
greatest risk.
3) Have you used http or https for Logon.aspx pages and why?
4) Anyone know if IIS on Windows Server 2003 has https built in? Easy or hard to
configure?
|
by: Daniel Frechette |
last post by:
Hi,
Is it possible to have secured (SSL/HTTPS) and non-secured (HTTP)
content in the same page without breaking the security? I am developing
a secured reservation system in which the user can access Google Maps
(not secured). The map is embedded in the page and does not open in a
separate window.
What solution do you recommend? Use iframes? If so, how?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |