Recent

Author Topic: How programmatically create a self-signed certificate for https IdHttpServer  (Read 643 times)

jonyrh

  • Newbie
  • Posts: 3
Hi Everyone!

How programmatically create a self-signed certificate for https IdHttpServer?
I try use simple (<Lazarus>\fpc\3.2.0\source\packages\openssl), but no experience...  :-[


trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1440
  • Former Delphi 1-7, 10.2 user
« Last Edit: February 21, 2021, 10:02:52 am by trev »
Lazarus 2.1 r65061 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.1 r65070 FPC 3.3.1 r49223 macOS 11.2.3 aarch64 Xcode 12.4
Lazarus 2.1 r61574 FPC 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM

jonyrh

  • Newbie
  • Posts: 3
https://stackoverflow.com/questions/10175812/how-to-create-a-self-signed-certificate-with-openssl

But why not use a real free certificate from Let's Encrypt?

Thank! But, i want create without OpenSSL binaries, use only pas-library Indy/Synapse/OpenSSL. Is it possible?

now use:
Code: Pascal  [Select][+][-]
  1. {$IFDEF MSWINDOWS}
  2.      RunCommand('cmd', ['/c','openssl req -x509 -newkey rsa:2048 -days 3650 -nodes -keyout "' + fn + '" -out "' + fn + '" -subj "' + outStr + '"'], s);
  3. {$ENDIF}
  4. {$IFDEF LINUX}
  5.      RunCommand('openssl', ['req','-x509','-newkey','rsa:2048','-days','3650','-nodes','-keyout', fn, '-out', fn,'-subj', outStr], s);
  6. {$ENDIF}
  7.  

certificate need for others PC, outStr = '/CN=10.XX.XX.XX/CN=192.XX.XX.XX'
« Last Edit: February 21, 2021, 10:29:54 am by jonyrh »

 

TinyPortal © 2005-2018