Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QsslSocket - ECC Keys & Certificate fail on OSX
Forum Updated to NodeBB v4.3 + New Features

QsslSocket - ECC Keys & Certificate fail on OSX

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 866 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • dheerendraD Offline
    dheerendraD Offline
    dheerendra
    Qt Champions 2022
    wrote on last edited by
    #1

    Question - Any problems/issues with ECC(Elliptic Curve Cryptography) Keys & Certificates on OSX ?
    I am using OpenSSL 1.0.2k on OS X EL Captain. I used the following commands to generate ECC Keys & Certificates. Keys and Certificates are generated properly. However when I set the key & certificates I get the following error.

    qDebug() << " Key ="<< key  << endl;
    qDebug() << " Certificate ="<< certificate << endl;
    socket->setProtocol(QSsl::TlsV1SslV3);
    socket->setPrivateKey(key,QSsl::Ec);
    socket->setLocalCertificate(certificate);
    
    socket->setPeerVerifyMode(QSslSocket::VerifyNone);
    socket->setCiphers("ECDHE-ECDSA-AES128-SHA256");
    socket->startServerEncryption();
    

    Error - Connection from ::1:50351 failed: SecPKCS12Import failed: -67712

    Commands used for generating ECC Key & Certificates.

    openssl ecparam -genkey -name prime256v1 -out key.pem
    openssl req -new -sha256 -key key.pem -out csr.csr
    openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem
    openssl req -in csr.csr -text -noout | grep -i "Signature.*SHA256" && echo "All is well" || echo "This certificate will stop working in 2017! You must update OpenSSL to generate a widely-compatible certificate"

    I use the same SSL library for generating the RSA 2048 keys and certificate. It works perfectly.

    Any issue with ECC Keys & Certificates on OSX

    Dheerendra
    @Community Service
    Certified Qt Specialist
    http://www.pthinks.com

    1 Reply Last reply
    2
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      I found the problem with this. Qt does not support EC Curves by default. It has dummy implemenation & does nothing. Not sure about the reason why this is left out.

      If you want Elliptical Curve Certificate Support on OSX with Qt, you need link Qt with OpenSSL library. This solves the problem. If any needs to help on this, do drop an email to me.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved