mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-11-23 18:03:30 +08:00
Merge pull request #161 from mfleisz/certcallback
settings: Added --ignore-certificates command line
This commit is contained in:
commit
505426e31f
@ -240,6 +240,7 @@ struct rdp_settings
|
||||
char* privatekey_file;
|
||||
|
||||
boolean autologon;
|
||||
boolean ignore_certificate;
|
||||
boolean compression;
|
||||
|
||||
boolean ipv6;
|
||||
|
@ -259,19 +259,21 @@ int tls_verify_certificate(CryptoCert cert, rdpSettings* settings, char* hostnam
|
||||
|
||||
if (certstore->match == 1)
|
||||
{
|
||||
char* issuer = crypto_cert_issuer(cert->px509);
|
||||
char* subject = crypto_cert_subject(cert->px509);
|
||||
char* fingerprint = crypto_cert_fingerprint(cert->px509);
|
||||
boolean accept_certificate = settings->ignore_certificate;
|
||||
if(!accept_certificate)
|
||||
{
|
||||
char* issuer = crypto_cert_issuer(cert->px509);
|
||||
char* subject = crypto_cert_subject(cert->px509);
|
||||
char* fingerprint = crypto_cert_fingerprint(cert->px509);
|
||||
|
||||
boolean accept_certificate = False;
|
||||
freerdp* instance = (freerdp*)settings->instance;
|
||||
freerdp* instance = (freerdp*)settings->instance;
|
||||
if(instance->VerifyCertificate)
|
||||
accept_certificate = instance->VerifyCertificate(instance, subject, issuer, fingerprint);
|
||||
|
||||
if(instance->VerifyCertificate)
|
||||
accept_certificate = instance->VerifyCertificate(instance, subject, issuer, fingerprint);
|
||||
|
||||
xfree(issuer);
|
||||
xfree(subject);
|
||||
xfree(fingerprint);
|
||||
xfree(issuer);
|
||||
xfree(subject);
|
||||
xfree(fingerprint);
|
||||
}
|
||||
|
||||
if(!accept_certificate)
|
||||
return 1;
|
||||
|
@ -89,6 +89,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
" --no-rdp: disable Standard RDP encryption\n"
|
||||
" --no-tls: disable TLS encryption\n"
|
||||
" --no-nla: disable network level authentication\n"
|
||||
" --ignore-certificate: ignore verification of logon certificate\n"
|
||||
" --sec: force protocol security (rdp, tls or nla)\n"
|
||||
" --version: print version information\n"
|
||||
"\n", argv[0]);
|
||||
@ -257,6 +258,10 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
{
|
||||
settings->authentication = False;
|
||||
}
|
||||
else if (strcmp("--ignore-certificate", argv[index]) == 0)
|
||||
{
|
||||
settings->ignore_certificate = True;
|
||||
}
|
||||
else if (strcmp("--no-fastpath", argv[index]) == 0)
|
||||
{
|
||||
settings->fastpath_input = False;
|
||||
|
Loading…
Reference in New Issue
Block a user