botan icon indicating copy to clipboard operation
botan copied to clipboard

Botan 2.x

Open anton-dutov opened this issue 8 years ago • 5 comments

Any plans about subj?

anton-dutov avatar Jan 27 '17 17:01 anton-dutov

Anything more specific about features requested from 2.x ?

etcimon avatar Jan 27 '17 17:01 etcimon

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

anton-dutov avatar Jan 27 '17 17:01 anton-dutov

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

denizzzka avatar Apr 02 '18 19:04 denizzzka

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

etcimon avatar Apr 02 '18 23:04 etcimon

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();
}

denizzzka avatar Apr 03 '18 08:04 denizzzka

This had been fixed down the road

etcimon avatar Feb 23 '23 19:02 etcimon