Recent

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

jonyrh

  • New Member
  • *
  • Posts: 17
    • Jony Rh Homepage
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: 2023
  • Former Delphi 1-7, 10.2 user
« Last Edit: February 21, 2021, 10:02:52 am by trev »

jonyrh

  • New Member
  • *
  • Posts: 17
    • Jony Rh Homepage
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