Skip to content

Conversation

@minggi
Copy link
Contributor

@minggi minggi commented Jun 20, 2017

No description provided.

@siscia
Copy link

siscia commented Jun 20, 2017

🎉 🎉 🎉 🎉 🎉 🎉

Congrats for your pull request :)

I believe the code it is very reasonable.

Let's wait for feedback from brocaar and we will move from there :)

opts.SetConnectionLostHandler(b.onConnectionLost)


if len(cafile) != 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively you could also put if cafile != ""


if len(cafile) != 0 {
tlsconfig, err := NewTLSConfig(cafile)
if(err == nil) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to put () around the err == nil

if len(cafile) != 0 {
tlsconfig, err := NewTLSConfig(cafile)
if(err == nil) {
opts.SetClientID("ssl-client").SetTLSConfig(tlsconfig)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason to use the SetClientID? You might run into trouble when you have multiple LoRa Gateway Bridge instances. I think only one connection per client ID is allowed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brocaar, you are perfectly right on this.

However just for let you know some MQTT server allow load balacing based on the clientID, it is quite a nice feature.

https://vernemq.com/docs/configuration/balancing.html

EnvVar: "MQTT_PASSWORD",
},
cli.StringFlag{
Name: "cafile",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be better to keep this specific to MQTT, thus mqtt-cafile MQTT_CAFILE? Or mqtt-ca-cert and MQTT_CA_CERT (to keep the naming consistent with the LoRa Server / LoRa App Server config flags).

@brocaar
Copy link
Collaborator

brocaar commented Jun 21, 2017

Thanks! I have added a few comments (just a few consistency related comments). Would you be able make these changes? Then I think it is good to merge :-)

--mqtt-username MQTT username [$MQTT_USERNAME]
--mqtt-password MQTT password [$MQTT_PASSWORD]
--cafile CA certificate file [$CAFILE]
--mqtt-ca-cert CA certificate file [$CAFILE]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change also the ENV variable

EnvVar: "CAFILE",
Name: "mqtt-ca-cert",
Usage: "mqtt CA certificate file (optional)",
EnvVar: "MQTT_CA_CERT",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@minggi
Copy link
Contributor Author

minggi commented Jun 21, 2017

@brocaar : Changes are done... and it works on my gateway.
If this is ok, I will write a short installation manual for the lorixOne LorixOne Gateway.

@siscia
Copy link

siscia commented Jun 21, 2017

OT
@minggi , do you mind to write me an email, I am quite interested in those little gateways that you linked.

@brocaar brocaar merged commit ac91023 into chirpstack:master Jun 22, 2017
@siscia
Copy link

siscia commented Jun 22, 2017

@brocaar , do you want me to add this change to the other loraserver and the lora-app-server too?

@brocaar
Copy link
Collaborator

brocaar commented Jun 23, 2017

If you would like to do so, that would be great!

@nickumbe
Copy link

This is working on my Conduit Gateways. Thank you! It would be great if lora-gateway-bridge could support client certificate authentication with MQTT as well.

@siscia
Copy link

siscia commented Jun 24, 2017

@nickumbe , it doesn't look too difficult, why you don't try to submit a pull request?

Look at the previous thread about this issues: #37

You see how minggi was supported?

If you are interested in the feature the simplest thing you can do is to implement it yourself, ask feedback, fix whatever need to be fixed and finally get it merged.

Bonus point, after the first PR is accepted it is simpler to implement it in other parts of the architecture: brocaar/chirpstack-network-server#190

@brocaar brocaar mentioned this pull request Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants