flagflag  If you want to see English page, please click "English" Button at Left.

Re: Rollback money server

このトピックの投稿一覧へ

なし Re: Rollback money server

msg# 1.6.1
depth:
2
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2011-4-20 13:26
iseki  Home away from home   投稿数: 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
引用:
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)
投票数:103 平均点:4.17

投稿ツリー

  条件検索へ


サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2025年 7月翌月
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
<今日>

オンライン状況

68 人のユーザが現在オンラインです。 (1 人のユーザが Forum を参照しています。)

登録ユーザ: 0
ゲスト: 68

もっと...

アクセスカウンタ

今日 : 6340634063406340
昨日 : 1029010290102901029010290
総計 : 2745960027459600274596002745960027459600274596002745960027459600
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com