adding SSL cert - WeOnlyDo Discussion board

adding SSL cert (wodWebServer / wodWebServer.NET)

by dirk, Friday, March 18, 2011, 20:51 (4997 days ago)

I'm trying to add a self-sign SSL cert to my app (using wodWebServer).
Via http://www.selfsignedcertificate.com/ I generated a cert.
It generates a .KEY and a .CERT file.
From my understanding the .KEY is what you would call in the C:Program FilesWeOnlyDo.ComWebServerSamplesVBComponent3. SSL Server sample the .PEM file. And the .CERT seems to be the .KEY file, is that correct?

Re: adding SSL cert

by woddrazen, Friday, March 18, 2011, 20:59 (4997 days ago) @ dirk

Dirk,


Actually .key is .key (this is private key) and .cert is .pem (this is certificate).

So it should look something like this:
[code]cert.Load App.Path & \cert.cert
cert.LoadKey App.Path & \cert.key [/code]
You can check this out if you open those files inside some text editor (notepad for example).


Drazen

Re: adding SSL cert

by dirk, Friday, March 18, 2011, 22:04 (4997 days ago) @ woddrazen

Dirk,


Actually .key is .key (this is private key) and .cert is .pem (this is certificate).

So it should look something like this:
[code]cert.Load App.Path & \cert.cert
cert.LoadKey App.Path & \cert.key [/code]
You can check this out if you open those files inside some text editor (notepad for example).


Drazen


Ok thanks

Additional question:
if I use
cert.generatekey 0
cert.generate
cert.save cert.pem
cert.savekey cert.key
in order to let the component generate a certificate, is it then possible to change the start/end date of the certificate? It seems to show as start/end date of the certificate 12/30/1999.

Re: adding SSL cert

by woddrazen, Friday, March 18, 2011, 22:24 (4997 days ago) @ dirk

Dirk,


Yes, you can add start/end date of the certificate using wodCertificate ValidFrom and ValidTo Property.

You need to do that when you generate certificate.


Drazen

Re: adding SSL cert

by dirk, Friday, March 18, 2011, 22:28 (4997 days ago) @ woddrazen

Dirk,


Yes, you can add start/end date of the certificate using wodCertificate ValidFrom and ValidTo Property.

You need to do that when you generate certificate.


Drazen

Ok this seems to give me 2 years from today:
cert.GenerateKey 0 ' RSA key
cert.ValidFrom = Date
cert.ValidTo = DateAdd( yyyy , 2, Date)
cert.Generate

Thanks for the quick help