Comments (6)
I added _tlsSettings :: TLSSettings
to the MQTTConfig
type and plumbed that through for both mqtts://
and wss://
connections. It's TLSSettings so you should be able to either a simple or full set of settings to configure the TLS bits of your client.
Let me know how this works!
from mqtt-hs.
For those, inexperienced like me, you need to populate ClientHooks
with appropriate onCertificateRequest
and onServerCertificate
functions like here: https://stackoverflow.com/a/40082394/1663197.
from mqtt-hs.
Hmm... I was wondering how this might work, but haven't needed it myself. It's definitely something I need to consider.
I may need to abstract TLS settings in such a way I can supply TLS settings for both mqtts
and wss
since doing it from the URI is kind of hard.
In the meantime, I did expose the lower-level conduit mechanism. mqtts
translates approximately torunClientTLS
which is implemented like this:
-- | Set up and run a client connected via TLS.
runClientTLS :: MQTTConfig -> IO MQTTClient
runClientTLS cfg@MQTTConfig{..} = tcpCompat (runTLSClient (tlsClientConfig _port (BCS.pack _hostname))) cfg
-- Compatibility mechanisms for TCP Conduit bits.
tcpCompat :: ((AppData -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
tcpCompat mkconn = runMQTTConduit (adapt mkconn)
where adapt mk f = mk (f . adaptor)
adaptor ad = (appSource ad, appSink ad)
from mqtt-hs.
I filed snoyberg/conduit/issues/423 for this. I don't see how I'd actually supply this to the underlying conduit TLS connector.
from mqtt-hs.
I figured you could use the TLSClientConfig
constructor instead of the tlsClientConfig
helper method
from mqtt-hs.
Can confirm this works as expected. Thanks!
from mqtt-hs.
Related Issues (19)
- Inbound alias resolution can sometimes fail due to ordering
- Async callbacks are problematic when receiving ordered messages HOT 6
- Use uri-bytestring instead of network-uri? HOT 2
- Fix package on nixpkgs HOT 2
- Connect To MQTT with a different Config for URI HOT 4
- mqtt-hs for an MQTT server HOT 4
- Namings HOT 2
- Support over http proxies HOT 1
- Export `Filter` and `Topic` constructors HOT 1
- ReadMe contains missing #pragma directive line HOT 1
- Unable to parse packets from an EMQ X broker with QoS > 0 HOT 7
- 0.8.2.3 ? HOT 3
- Try to reconnect to broker on unexpected disconnect? HOT 2
- How to set PropAuthenticationMethod and PropAuthenticationData
- How can I set the clientId? HOT 2
- Add to Stackage? HOT 4
- Logging capabilities in callbacks HOT 1
- Thread blocked indefinitely HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mqtt-hs.