mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 11:00:28 +02:00
* Better creation of self-signed certificates. Patch by Anton (@odisey1245). Fixes issue #40553
This commit is contained in:
parent
a009cc5c35
commit
fb9bcac2d3
@ -220,7 +220,7 @@ function TX509Certificate.GetKeySize: Integer;
|
|||||||
begin
|
begin
|
||||||
Result:=FKeySize;
|
Result:=FKeySize;
|
||||||
if Result=0 then
|
if Result=0 then
|
||||||
Result:=1024;
|
Result:=2048;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TX509Certificate.GetValidFrom: TDateTime;
|
function TX509Certificate.GetValidFrom: TDateTime;
|
||||||
|
@ -244,9 +244,9 @@ var
|
|||||||
begin
|
begin
|
||||||
Utc:=Asn1UtctimeNew;
|
Utc:=Asn1UtctimeNew;
|
||||||
try
|
try
|
||||||
ASN1UtcTimeSetString(Utc,PAnsiChar(FormatDateTime('YYMMDDHHNNSS',ValidFrom)));
|
ASN1UtcTimeSetString(Utc,PAnsiChar(FormatDateTime('YYMMDDHHNNSS"Z"',ValidFrom)));
|
||||||
X509SetNotBefore(x, Utc);
|
X509SetNotBefore(x, Utc);
|
||||||
ASN1UtcTimeSetString(Utc,PAnsiChar(FormatDateTime('YYMMDDHHNNSS',ValidTo)));
|
ASN1UtcTimeSetString(Utc,PAnsiChar(FormatDateTime('YYMMDDHHNNSS"Z"',ValidTo)));
|
||||||
X509SetNotAfter(x,Utc);
|
X509SetNotAfter(x,Utc);
|
||||||
finally
|
finally
|
||||||
Asn1UtctimeFree(Utc);
|
Asn1UtctimeFree(Utc);
|
||||||
|
Loading…
Reference in New Issue
Block a user