Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created April 22, 2012 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ynonp/2462852 to your computer and use it in GitHub Desktop.
Save ynonp/2462852 to your computer and use it in GitHub Desktop.
filters out expired certificates
QList<QSslCertificate> cacerts = QSslCertificate::fromPath(capath);
QList<QSslCertificate> liveCerts;
QDateTime now = QDateTime::currentDateTime();
foreach ( QSslCertificate c, cacerts )
{
if ( c.expiryDate() > now )
{
liveCerts << c;
}
}
QSslSocket::setDefaultCaCertificates( liveCerts );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment