etcimon / botan

Block & stream ciphers, public key crypto, hashing, KDF, MAC, PKCS, TLS, ASN.1, BER/DER, etc.
Other
86 stars 22 forks source link

Botan 2.x #27

Closed anton-dutov closed 1 year ago

anton-dutov commented 7 years ago

Any plans about subj?

etcimon commented 7 years ago

Anything more specific about features requested from 2.x ?

anton-dutov commented 7 years ago

Nothing at now, but 1.x development stopped, support only,

denizzzka commented 6 years ago

We tried to use Botan as backend for Vibe.d https client and got:

object.Exception@/home/vagrant/.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/botan.d(246): TLS Alert Received: illegal_parameter

With browser request of this url works fine.

Debugging of it is too hard because it is not clear what field server does not like and we can't control this server (but other popular servers works ok with botan). Maybe it is because current Botan is obsolete?

TLS handshake "Hello" Wireshark info: image

etcimon commented 6 years ago

Which certificate/format are you using? This botan version isn't the same as the C++ botan, I built it mostly because it allowed me to more easily customize certain aspects of TLS in D and so I could build the whole project in dub. If you have the opportunity to use OpenSSL and don't specifically need to tweak TLS in D you could use that vibe.d configuration instead

denizzzka commented 6 years ago

Which certificate/format are you using?

Hmm... Isn't know, some default from Vibe.d. It is fails on TLS1.2 handshake immediately after first "hello" package is sent. Not reaching the exchange of certificates.

Code sample:

import vibe.http.client;
import vibe.stream.operations: readAllUTF8;
import vibe.core.log;

void getCollections() {
  HTTPClientSettings settings = new HTTPClientSettings;

    requestHTTP("https://api.hubapi.com/contacts/v1/lists/all/contacts/all",
    (scope req){
          req.method = HTTPMethod.GET;
        },
        (scope res){
          logInfo("Headers:");
          foreach(key, ref value; res.headers) {
            logInfo("%s: %s", key, value);
          }
          logInfo("Response: %s", res.bodyReader.readAllUTF8());
        },
        settings
  );
}

unittest{
  logInfo("HUBSPOT TEST ============================");
  getCollections();
}
etcimon commented 1 year ago

This had been fixed down the road