Modify X509Certificate to the latest standard

From Array Suite Wiki

Jump to: navigation, search

Mono 2.10.9 may thrown harmless error message during analysis, such as

Unsupported hash algorithm: 1.2.840.113549.1.1.11
 at Mono.Security.X509.X509Certificate.VerifySignature (System.Security.Cryptography.RSA rsa) [0x00000] in <filename unknown>:0
 at Mono.Security.X509.X509Certificate.VerifySignature (System.Security.Cryptography.AsymmetricAlgorithm aa) [0x00000] in <filename unknown>:0
 at System.Security.Cryptography.X509Certificates.X509Chain.IsSignedWith (System.Security.Cryptography.X509Certificates.X509Certificate2 signed, System.Security.Cryptography.AsymmetricAlgorithm pubkey) [0x00000] in <filename unknown>:0
 at System.Security.Cryptography.X509Certificates.X509Chain.Process (Int32 n) [0x00000] in <filename unknown>:0
 at System.Security.Cryptography.X509Certificates.X509Chain.ValidateChain (X509ChainStatusFlags flag) [0x00000] in <filename unknown>:0
 at System.Security.Cryptography.X509Certificates.X509Chain.Build (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate) [0x00000] in <filename unknown>:0
 --- End of inner exception stack trace ---
 at System.Security.Cryptography.X509Certificates.X509Chain.Build (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate) [0x00000] in <filename unknown>:0
 at System.Net.ServicePointManager+ChainValidationHelper.ValidateChain (Mono.Security.X509.X509CertificateCollection certs) [0x00000] in <filename unknown>:0
Please, report this problem to the Mono team

In order to completely eliminate this annoying message, admin can make a few lines modifications to

/opt/mono-2.10.9/mcs/class/Mono.Security/Mono.Security.X509/X509Certificate.cs

Admin can download modified X509Certificate.cs file:

cd /opt/mono-2.10.9/mcs/class/Mono.Security/Mono.Security.X509/
mv X509Certificate.cs X509Certificate.cs.old
wget http://omicsoft.com/software/ArrayServer/X509Certificate.cs.gz
gunzip X509Certificate.cs.gz

We made the following modifications

Mono2109Certificate1.png

Mono2109Certificate2.png

Mono2109Certificate3.png

Our modifications is based on instruction shown in bugzilla.xamarin.com