Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1000833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:34:31+00:00 2026-05-16T07:34:31+00:00

I am trying to access a REST webservice, however my code doesn’t work and

  • 0

I am trying to access a REST webservice, however my code doesn’t work and keeps throwing a HTTP 401 error

see this example screen cap from Wireshark of the initial ssl request:

WireShark Screenshot

This is from a Curl call to the same web address with the same details. The issue is that under my VB.NET version the “Extension: server_name” (and related) part of the SSL packet is missing, I believe that this is causing the server to not reply with the Server key exchange in the next couple packets.

Below is the VB.NET code

    Dim webRequest As HttpWebRequest = DirectCast(System.Net.WebRequest.Create(UrlString), HttpWebRequest)
    webRequest.Method = "GET"
    webRequest.ContentType = "application/x-www-form-urlencoded"

    webRequest.Credentials = New NetworkCredential(username, password)

    Dim response As HttpWebResponse = DirectCast(webRequest.GetResponse(), HttpWebResponse)

This fails on the last line (HTTP 401 error), issue does not seem to be related to my proxy and the user credentials are correct for the server as this request works from Curl and wget.

I have already tried setting the AuthenticationLevel as well as manually setting the Authorization header, and PreAuthenticate doesn’t seem to change this issue either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:34:31+00:00Added an answer on May 16, 2026 at 7:34 am

    The answer was that the WebService was not replying with a valid HTTP401 WWW-Authenticate header, instead was just returning with code like:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Error>
        <ErrorCode>NO_SUITABLE_AUTHENTICATION_METHOD</ErrorCode>
        <ErrorDescription>No suitable active authentication mechanism found to authorise request - authorise using supported mechanisms</ErrorDescription>
        <RequestID>gcqsrtvn</RequestID>
        <SystemTime>2010-08-12T09:14:21.831+10:00</SystemTime>
    </Error>
    

    So I had to manually add the authentication header as shown here:
    http://devproj20.blogspot.com/2008/02/assigning-basic-authorization-http.html

    code:

    Dim authBytes() As Byte = System.Text.Encoding.UTF8.GetBytes(String.Format("{0}:{1}", username, password).ToCharArray())
    webRequest.Headers("Authorization") = "Basic " + Convert.ToBase64String(authBytes)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.