0
votes

Since my site uses ssl certificate, I can no longer access an xml file from my server. Please help me.

I have 4 files from ZeroSSL page: account-key.txt; (RSA PRIVATE KEY) domain-csr.txt; (CRT) (CABUNDLE) 2OmkvG1CfXtJ-sYpp5mV0......; (File without extension) qGGRddmOl62soMPdlCBeamnR......; (File without extension)

The url now start with https, my current code is:

string currentVersion = GetWebPage("http://sofobot.com/version.xml");
XmlDocument VersionInfo = new XmlDocument();
VersionInfo.LoadXml(currentVersion);
.
.
public static string GetWebPage(string URL)
        {                        
            System.Net.HttpWebRequest Request = (HttpWebRequest)(WebRequest.Create(new Uri(URL)));           
            Request.Method = "GET";
            Request.MaximumAutomaticRedirections = 4;
            Request.MaximumResponseHeadersLength = 4;            
            Request.ContentLength = 0;          
            StreamReader ReadStream = null;
            HttpWebResponse Response = null;
            string ResponseText = string.Empty;                                                                
            Response = (HttpWebResponse)(Request.GetResponse());
            Stream ReceiveStream = Response.GetResponseStream();
            ReadStream = new StreamReader(ReceiveStream, System.Text.Encoding.UTF8);
            ResponseText = ReadStream.ReadToEnd();
            Response.Close();
            ReadStream.Close();           
            return ResponseText;
        }

enter image description here Error InnerException -> stacktrace:

en System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) en System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) en System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) en System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) en System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) en System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) en System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) en System.Net.ConnectStream.WriteHeaders(Boolean async)

2
What error are you getting? Is the cert valid? (if you go to the url in your web browser, does it show as a valid https connection)Jonathan

2 Answers

0
votes

There is no need to share your SSL certificate information.

I would consider that it might be a simple solution

string currentVersion = GetWebPage("http://sofobot.com/version.xml"); // https!

You need to change the protocol to HTTPS instead of using HTTP

0
votes

I found solution

I had to delete file .HTACCESS on my server. This file contains this code:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

The url hold in "http//"