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 8566933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:46:09+00:00 2026-06-11T17:46:09+00:00

I have just installed monodevelop from ubuntu software centre and created a solution. I

  • 0

I have just installed monodevelop from ubuntu software centre and created a solution. I am trying to do WebRequest.create(url). But it keeps throwing “The authentication or decryption has failed”. What am I doing wrong? If I am not doing anything wrong what should I do to make the above work!

I have searched about this but I couldn’t come up with a solution that will fix my problem!

Here is what I do …

public static string AccessURL(string url, string postcontent)
    {
        WebRequest request = WebRequest.Create(url);
        request.Method = "POST";
        byte[] byteArray = Encoding.UTF8.GetBytes(postcontent);
        request.ContentType = "application/x-www-form-urlencoded";
        request.ContentLength = byteArray.Length;
        Stream dataStream = request.GetRequestStream();
        dataStream.Write(byteArray, 0, byteArray.Length);
        dataStream.Close();
        WebResponse response = request.GetResponse();
        dataStream = response.GetResponseStream();
        StreamReader reader = new StreamReader(dataStream);
        string responseFromServer = reader.ReadToEnd();
        reader.Close();
        dataStream.Close();
        response.Close();
        return responseFromServer;
    }

Thanks in advance!

  • 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-06-11T17:46:10+00:00Added an answer on June 11, 2026 at 5:46 pm

    The error suggests that you are trying to access a SSL/TLS encrypted resource. Mono does not trust any these sites per default and is up to the developer to determine whether you want to access that resource or not. More about this in mono’s security FAQ.

    So one way to do this is to implement a ServerCertificateValidationCallback in your class:

    using System.IO;
    using System.Net;
    using System.Net.Security;
    using System.Security.Cryptography.X509Certificates;
    using System.Text;
    
    public class MyAwesomeProgram
    {
        public MyAwesomeProgram() 
        {
            ServicePointManager.ServerCertificateValidationCallback =
                    ValidateServerCertficate;
        }
    
        private static bool ValidateServerCertficate(object sender, X509Certificate certificate,
            X509Chain chain, SslPolicyErrors sslpolicyerrors)
        {
            //This is where you should validate the remote certificate
            return true;
        }
    
        public void FetchAwesomeStuff (string url) 
        {
            var wr = WebRequest.Create (url);
            var stream = wr.GetResponse().GetResponseStream ();
            Console.WriteLine (new StreamReader (stream).ReadToEnd ());
        }
    }
    

    There are more examples in the mono documentation about using Certificate Policies and Trusting Roots. Notice the sample above ignores the security and accepts all certificates, even those you might not trust. This is not recommended to use!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just installed the new MonoDevelop Windows beta, but when trying to create a
I have the problem I just installed the new Monodevelop 2.2.2 on Windows but
I have just installed Ubuntu. I am a new user to ubuntu but have
I have just installed the sample from Urlrewriter.net, but I can't seem to figure
I have just installed composer in my /usr/bin folder, so when from that folder
I have just installed Git For Windows , and created my SSH key using
I have just installed Visual Studio 2010. when I attempt to create a new
I just installed MonoDevelop on my Mac (Snow Leopard). I'm a .NET developer, but
I have just installed Mono 2.10.1_3, MonoDevelop 2.4.2, and MonoTouch 4.0.3. In the order
I have just installed the IMP plugin for Eclipse but the IMP menus don't

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.