flagflag  

Re: Rollback money server

List posts in the topic

なし Re: Rollback money server

msg# 1.6.1
depth:
2
Previous post - Next post | Parent - No child | Posted on 2011/4/20 13:26
iseki  Home away from home   Posts: 1581
Hi everyone.

I understand the cause of this problem now.

At r/15147, ValidateServerCertificate() function was added to ScriptsHttpRequests.cs
So, this function refused certificate file that we use.
This certificate file (SineWaveCert.pfx) had been used since DTL Currency Server.

We are thinking about the best method for this problem.
If there is a good idea, please teach us.


diff of r/15146 and r/15147
Quote:
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index d78931a..a37c781 100644
--- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -29,8 +29,10 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
+using System.Net.Security;
using System.Text;
using System.Threading;
+using System.Security.Cryptography.X509Certificates;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
@@ -84,6 +86,7 @@ using OpenSim.Region.Framework.Scenes;

namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
{
+
public class HttpRequestModule : IRegionModule, IHttpRequestModule
{
private object HttpListLock = new object();
@@ -100,8 +103,23 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest

public HttpRequestModule()
{
+ ServicePointManager.ServerCertificateValidationCallback +=ValidateServerCertificate;
}

+ public static bool ValidateServerCertificate(
+ object sender,
+ X509Certificate certificate,
+ X509Chain chain,
+ SslPolicyErrors sslPolicyErrors)
+ {
+ HttpWebRequest Request = (HttpWebRequest)sender;
+
+ if(Request.Headers.Get("NoVerifyCert") != null)
+ {
+ return true;
+ }
+ return chain.Build(new X509Certificate2(certificate));
+ }
#region IHttpRequestModule Members

public UUID MakeHttpRequest(string url, string parameters, string body)
@@ -141,8 +159,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
break;

case (int)HttpRequestConstants.HTTP_VERIFY_CERT:
-
- // TODO implement me
+ htc.HttpVerifyCert = (int.Parse(parms[i + 1]) != 0);
break;
}
}
@@ -282,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
public string HttpMethod = "GET";
public string HttpMIMEType = "text/plain;charset=utf-8";
public int HttpTimeout;
- // public bool HttpVerifyCert = true; // not implemented
+ public bool HttpVerifyCert = true; // not implemented
private Thread httpThread;

// Request info
@@ -344,6 +361,17 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
Request.Method = HttpMethod;
Request.ContentType = HttpMIMEType;

+ if(!HttpVerifyCert)
+ {
+ // Connection Group Name is probably not used so we hijack it to identify
+ // a desired security exception
+// Request.ConnectionGroupName="NoVerify";
+ Request.Headers.Add("NoVerifyCert" , "true");
+ }
+// else
+// {
+// Request.ConnectionGroupName="Verify";
+// }
if (proxyurl != null && proxyurl.Length > 0)
{
if (proxyexcepts != null && proxyexcepts.Length > 0)
Votes:103 Average:4.17

Posts tree

  Advanced search


Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthJul 2025Next Month
Su Mo Tu We Th Fr Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Today

Who's Online

73 user(s) are online (1 user(s) are browsing Forum)

Members: 0
Guests: 73

more...

Access Counter

Today : 7804780478047804
Yesterday : 1029010290102901029010290
Total : 2746106427461064274610642746106427461064274610642746106427461064
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com