469,904 Members | 2,273 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

403 forbidden -

Hi

I am accessing the TransUnionNetAccess's secured site requesting for the
Credit Score.
Since i have the p12 certificate i am using third party dll [
Org.Mentalis.Security.Certificates]
to convert p12 to x509 certificate.

When i access the secured url "https://test.TransUnionNetAccess.com:3018" i
get
a dialog window asking for trusting the certificate and after selecting "ok"
i get "invalid request"

That part is ok as i am not sending any valid input messages to the secured
site.

My problem is when i call the Request through the .net code i get the error

"An unhandled exception of type 'System.Net.WebException' occurred in
system.dll
Additional information: The remote server returned an error: (403)
Forbidden."

I have installed the certificate in
"Personal" , "Trusted Root Certification Authorities" and "intermediate
Certification Authorities" stores.

what could be the reason ?

Below is the code
// Convert p12 to x509 format.
Certificate oldCertFormat =
Certificate.CreateFromPfxFile(certificatePath,"<pa ssword>");
X509Certificate newCertificateFormat = oldCertFormat.ToX509();

System.Net.ServicePointManager.CertificatePolicy = new
TrustAllCertificatePolicy();

// Prepare web request...
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create("https://test.TransUnionNetAccess.com:3018");

System.Net.ServicePointManager.CertificatePolicy = new
TrustAllCertificatePolicy();

request.Method = "POST";
request.ContentType = "text/xml";
request.ContentLength = requestData.Length;
request.ClientCertificates.Add(newCertificateForma t);

// Send the data.
requestDetails = request.GetRequestStream();
requestDetails.Write(requestData,0,requestData.Len gth);
requestDetails.Close();
// Get the Web Response

responseDetails = request.GetResponse().GetResponseStream();
readerObject = new StreamReader(responseDetails);
responseData = readerObject.ReadToEnd();
readerObject.Close();
responseDetails.Close();

return responseData;

---------------
public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy
{
public TrustAllCertificatePolicy()
{
}

public bool CheckValidationResult(ServicePoint sp,
X509Certificate cert,WebRequest req, int problem)
{
return true;
}
}
Regards
Guru
Jul 21 '05 #1
1 7536
I am just wondering that you have resolved your issue.
Because I am working on the c# program for TransUnion interface.

Thanks,

Kevin Bae
kevin.bae@umb.com

Hi

I am accessing the TransUnionNetAccess's secured site requesting for the
Credit Score.
Since i have the p12 certificate i am using third party dll [
Org.Mentalis.Security.Certificates]
to convert p12 to x509 certificate.

When i access the secured url "https://test.TransUnionNetAccess.com:3018" i
get
a dialog window asking for trusting the certificate and after selecting "ok"
i get "invalid request"

That part is ok as i am not sending any valid input messages to the secured
site.

My problem is when i call the Request through the .net code i get the error

"An unhandled exception of type 'System.Net.WebException' occurred in
system.dll
Additional information: The remote server returned an error: (403)
Forbidden."

I have installed the certificate in
"Personal" , "Trusted Root Certification Authorities" and "intermediate
Certification Authorities" stores.



what could be the reason ?



Below is the code


// Convert p12 to x509 format.
Certificate oldCertFormat =
Certificate.CreateFromPfxFile(certificatePath,"<pa ssword>");
X509Certificate newCertificateFormat = oldCertFormat.ToX509();

System.Net.ServicePointManager.CertificatePolicy = new
TrustAllCertificatePolicy();

// Prepare web request...
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create("https://test.TransUnionNetAccess.com:3018");

System.Net.ServicePointManager.CertificatePolicy = new
TrustAllCertificatePolicy();

request.Method = "POST";
request.ContentType = "text/xml";
request.ContentLength = requestData.Length;
request.ClientCertificates.Add(newCertificateForma t);

// Send the data.
requestDetails = request.GetRequestStream();
requestDetails.Write(requestData,0,requestData.Len gth);
requestDetails.Close();


// Get the Web Response

responseDetails = request.GetResponse().GetResponseStream();
readerObject = new StreamReader(responseDetails);
responseData = readerObject.ReadToEnd();


readerObject.Close();
responseDetails.Close();

return responseData;

---------------


public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy
{
public TrustAllCertificatePolicy()
{
}

public bool CheckValidationResult(ServicePoint sp,
X509Certificate cert,WebRequest req, int problem)
{
return true;
}
}


Regards
Guru
Mar 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Oleg Konovalov | last post: by
reply views Thread by Layne L via DotNetMonster.com | last post: by
8 posts views Thread by trinitypete | last post: by
4 posts views Thread by Ollie | last post: by
6 posts views Thread by Axel Dahmen | last post: by
reply views Thread by Geoff Murley | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.