News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
Own certificate does not work  
by Tim McClure [tim dot mcclure at ge dot com]
posted on 2003/12/16

I have created my own certificate to run with the WebServer example and it does not work. The WebServer does not with the pfx supplied in samples. The following is my stack trace, any help would be greatly appreciated:

This test class implements a small HTTP server that supports HTTP and HTTPS. It
always returns the same static page.

Please enter the IP address of the network adapter to listen on [use 0.0.0.0 to
listen on all installed network adapters]:
3.18.148.3
Please enter the port to listen on [or 0 to automatically select one]:
8082
Please enter the security protocol you wish to use for incoming connections:
[1] None
[2] SSL3
[3] TLS1
[4] SSL3 and TLS1
4
How do you want to load the certificate?
1 = from certificate store
2 = from PFX/P12 file
3 = from .cer file
2
Enter the full path of the certificate file:
c:\ssl\cert\fcapi.pfx
Enter the password of the PFX/P12 file:
whiskey
Using the following certificate:
CERTIFICATE:
Format: X509
Name: ppmerlin
Issuing CA: ppmerlin
Key Algorithm: 1.2.840.113549.1.1.4
Serial Number: EE93AE700815E844B9925F02A63B4A2F
Key Alogrithm Parameters: 0500
Public Key: 30818902818100E455D07BECD4B92754A02417AB801C768838FFDE51102
0B0D1C5F562F5EA6D44F78ECFF10CF6D8481272F248EDC75F2161A231894CDFD7EFD4F683129B8E1
6C6E892DA28284EEE2FA4396EE1B84165F4044DC3717D5E98C97CD9A666438CDDAD06015BB4260B0
EC556FE13A90FB74D60BDC240B8B52B228BA9EF89E61074D2EF0203010001
Press CTRL-BREAK to kill the server.
Listening on 3.18.148.3:8082
Incoming socket accepted.
Receiving HTTP request...
Error while receiving data from client [An error occurs while communicating with
the remote host.
Org.Mentalis.Security.Ssl.Shared.SslException: An error occurred during the decr
yption and verification process.
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.UnwrapMessage(RecordMessage m
essage)
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.ProcessBytes(Byte[] buffer, I
nt32 offset, Int32 size)
at Org.Mentalis.Security.Ssl.Shared.SocketController.OnReceive(IAsyncResult a
r)].
Org.Mentalis.Security.SecurityException: An error occurs while communicating wit
h the remote host.
Org.Mentalis.Security.Ssl.Shared.SslException: An error occurred during the decr
yption and verification process.
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.UnwrapMessage(RecordMessage m
essage)
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.ProcessBytes(Byte[] buffer, I
nt32 offset, Int32 size)
at Org.Mentalis.Security.Ssl.Shared.SocketController.OnReceive(IAsyncResult a
r) ---> Org.Mentalis.Security.Ssl.Shared.SslException: An error occurred during
the decryption and verification process.
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.UnwrapMessage(RecordMessage m
essage)
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.ProcessBytes(Byte[] buffer, I
nt32 offset, Int32 size)
at Org.Mentalis.Security.Ssl.Shared.SocketController.OnReceive(IAsyncResult a
r)
--- End of inner exception stack trace ---
at Org.Mentalis.Security.Ssl.SecureSocket.EndReceive(IAsyncResult asyncResult
)
at Org.Mentalis.Security.Ssl.SecureSocket.Receive(Byte[] buffer, Int32 offset
, Int32 size, SocketFlags socketFlags)
at WebServer.StartServer(IPEndPoint ep, SecureProtocol sp, Certificate cert)
in c:\ssl\webserver\consoleapplication1\consoleapplication1\webserver.cs:line 22
9
Waiting for another connection...
Incoming socket accepted.
Receiving HTTP request...
Client closed connection too soon.
Waiting for another connection...

by Tim McClure [tim dot mcclure at ge dot com]
posted on 2003/12/16

Sorry for the duplicate post, I actually did not see the reply link.

I figured out the problem. I am using makecert to create the certificate and I used the -sky default which specifies the type of key (signature or exchange) and it must be signature. When I explicitly stated exchange my certificate worked. I would nice if some how an error message could indicate this error. Also does the framework support any tracing or logging?

by vijay [vijay at hotmail dot com]
posted on 2005/03/20

Hello Tim,

I am attempting the same thing you did, and have run into similar problems. I created a self-signed server certificate and get the following error message:

Error while receiving data from client [An error occurs while communicating with
the remote host.
Org.Mentalis.Security.Ssl.Shared.SslException: An error occurred during the decr
yption and verification process.
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.UnwrapMessage(RecordMessage m
essage)
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.ProcessBytes(Byte[] buffer, I
nt32 offset, Int32 size)
at Org.Mentalis.Security.Ssl.Shared.SocketController.OnReceive(IAsyncResult a
r)].

Did you find a resolution to your problem? any help is appreciated.

regards,

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.