473,396 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C# SSL certificate

30
Hi all,

I am trying to establish a ssl socket using C#. I am fresh on this area and just trying to run the sample code on the msdn: http://msdn.microsoft.com/en-us/libr...sslstream.aspx.

First, i create my certificate, i got MyKey.cer, MyKey.pvk, MyKey.pfx, I use MyKey.cer to run the server in commond like:
Expand|Select|Wrap|Line Numbers
  1. sslserver.exe MyKey.cer
, server runs successfully. Then I run the client like
Expand|Select|Wrap|Line Numbers
  1. sslclient.exe localhost MyKey.pfx 
, connection wil be built, but throw a System.NotSupportedException on the server side.

I am not sure that I should use
Expand|Select|Wrap|Line Numbers
  1. sslclient.exe localhost MyKey.pfx 
to run the sslclient, I mean, probably I should use something to replace MyKey.pfx as the second parameter.

I also generate a pair of *.pem files to run my ssl program, there is the same problem that my server side can run but client side sucks, throwing the same exception.

Any suggestion on that? (Would be more helpful if someone can tell me how to use *.pem file to run the ssl program here)
Thank you and many thanks for the reading.
May 22 '09 #1
2 10596
anklos
30
Some more details on the question:
The exception also says my certificate is not associated with a private key, but I use "-pe" in my certificate generation command:
Expand|Select|Wrap|Line Numbers
  1. makecert -r -pe -n "CN=DS" -b 01/01/2008 -e 01/01/2010 -sr localMachine DSKey.cer
, it still doesn't work
May 22 '09 #2
Probably the problem is that your certificate has not the private key inside.
Try to use standard X509 certificate.
You can generate it on-line at this link

http://www.we-coffee.com/x509builder.aspx
Aug 9 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Matt Frame | last post by:
I am working on a special ASP.Net application that receives files from customers. The connection is made via HTTPS and the client sends the file as a POST to my ASP.Net listener. All of this...
1
by: Bob | last post by:
I'm building a .NET web service which requires client certificate for strong security. I set IIS to require SSL and client certificate (under site properties in IIS admin, Directory Security tab,...
0
by: Will | last post by:
It seems that I have scoured the net and came up empty handed. I have an ASP.net app that posts xml to another company's servlet. For some transactions, they do not require a certificate, but...
1
by: Nelson R. | last post by:
Hi, i need to get some info from a website page that requires an certificate. Ive got the provided certificate installed in IE, and when accessing the website page, it shows a window to...
6
by: JIM.H. | last post by:
Hello, I am trying to create a certificate for our internet for our employees so that they can login to system from home. Do I have to go, for example, VeriSign to get a certificate? Can I create...
1
by: | last post by:
Hi, I'd like to store X509 cetificates in a central location (file server, database, etc), and load them when needed, is it practical ? and in term of implementation, can this be achieved by...
0
by: jakobsgaard | last post by:
It is possible to Map a certificate to a Active Directory User Account from DotNet? Please provide an example. Best regards, Ejnar Jakobsgaard...
11
by: John Nagle | last post by:
The Python SSL object offers two methods from obtaining the info from an SSL certificate, "server()" and "issuer()". The actual values in the certificate are a series of name/value pairs in ASN.1...
2
by: ucb01 | last post by:
Hi, I am working with Visual Studio 2005 in C#. Using makecert I create a self-signed certificate A with a private key then a certificate B based on A. The first is installed in the...
4
by: =?Utf-8?B?SGVyYg==?= | last post by:
For some reason my application now requires that I "Sign the ClickOnce manifests". I don't know that it ever has before. I clicked the "Create Test Certificate" and after a reinstall everything is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.