Jump to content

Fredrik Larsson

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. Fredrik Larsson

    Use TSimpleWebSrv for localhost with certificate

    Hi, When I signed up it said: Redirect URI: https://localhost:44300/callback The redirect URI given above is only a temporary placeholder. Please contact us to register a redirect URI that is appropriate for your solution. Please keep in mind that we only support HTTPS protocol when you set up a redirect URI. But I will write them an e-mail about desktop solutions. Regards, Fredrik.
  2. Fredrik Larsson

    Use TSimpleWebSrv for localhost with certificate

    Cool! I will look into that code and try it. Seems to make sense and fairly straight forward. It's Visma which is a Swedish/Nordic accounting solution provider. I agree it's a bit over the top and I don't know why they have that requirement. Perhaps they are mostly considering online web applications. For anyone else who needs it, this seems to work: SimpleWebSrv1.WebSrvCertPassword := ''; SimpleWebSrv1.WebSrvCertBundle := ''; lAppDir := ExtractFileDir(ParamStr(0)); Log('Appdir=' + lAppDir); lCert := IncludeTrailingPathDelimiter(lAppDir) + 'cert-localhost.pem'; if NOT FileExists(lCert) then begin if NOT SslX509Certs1.CreateAcmeAlpnCert(lCert, 'localhost', '') then begin Log('Failed to Create LocalHost Certificate: ' + lCert); Exit; end; end; SimpleWebSrv1.WebSrvCertBundle := lCert; if not SimpleWebSrv1.StartSrv then Log('Server not started)') else Log('Server started');
  3. I have an OAuth2 where the callback needs to make a callback to https://localhost:44300 with a signed certificate. Optimal I would use RestOAuth but that doesn't support SSL callbacks so I need to tweak that a bit and use my own server for the SSL part. But I can't really figure out how to use TSimpleWebSrv fully in SSL mode. I get that I can listen to WebSrvPortSSL and that works but then what certificate to use? It's these properties I get: SimpleWebSrv1.WebSrvCertPassword := 'password'; SimpleWebSrv1.WebSrvCertBundle := 'whattouse.pem'; Is there a simple way to create a self signed localhost certificate? How would I use it? I can't really figure it out from demos either. Any input is appreciated. Regards, Fredrik
  4. Investigate the old D5 sample code for ICS. Alternatively you can use latest Delphi to build a dll which you can call from your legacy D5 application. That's how I did for one project.
×