Blog of Random Thoughts and Pictures

Bridging MQTT brokers and using security certs from Let’s Encrypt

October 14th, 2019

This is an item that came up while working on a project within the TSSG and so might be worth sharing.

Have you ever tried to use a MQTT broker ? Message Queuing Telemetry Transport (MQTT) is a machine-to-machine (M2M), Internet of Things data protocol, which is in line with other data protocols such as XMPP, CoAP, AMQP, and Websockets. Invented in 1999, MQTT is now an OASIS (Organization for the Advancement of Structured Information Standards) standard, and ISO standard (ISO/IEC PRF 20922).

MQTT is extensively used in Amazon Web Services, Microsoft Azure IoT Hub, IBM WebSphere MQ, and is a publish/subscribe message exchange pattern, that can support persistent message storage on the broker and supports security in the form of authentication using user name and password, and encryption using SSL/TLS.

For something like the Eclipse Mosquitto broker, MQTT it has a really small code footprint, the libmosquitto (client library) is about 1.3 MB and is ideal if processor or memory resources are limited and also ideal if bandwidth is low or network is unreliable. Classic problems in the IoT space.

In the case of using MQTT for the smart grid, scale and security are top priorities. To achieve scale I’ve looked at bridging MQTT brokers in a hub and spoke model, where a very light MQTT broker is at the edge of the network (at the end of the spoke) and there’s a large MQTT broker at the hub which can aggregate all the data.

However the purpose of this post is to highlight the security aspects within MQTT and in particular the application of encryption (SSL/TLS) when using Let’s Encrypt certificates. Applying a certificate to an MQTT broker is not too hard, there’s a nice guide here on Mosquitto SSL Configuration for MQTT TLS Security and here too on SSL/TLS Client Certs to Secure MQTT however in the vast majority of cases the examples use self-signed certs and not certs as provided by Let’s Encrypt.

By the way if you don’t know Let’s Encrypt is a non-profit certificate authority run by the Internet Security Research Group that provides X.509 certificates for Transport Layer Security encryption at no charge. The certificate is valid for 90 days and the renewal process is quite simple.

Now bridging two MQTT brokers can be relatively straight forward too however getting the certs right when you want that bridge to be encrypted can be a little tricky look at how much you have to do to bridge a Mosquitto MQTT Broker to AWS IoT.

In my case I wanted to bridge two Mosquitto MQTT Brokers, each with encryption enabled by a Let’s Encrypt cert. Firstly I created a [special Docker container]() that could pick up the Let’s Encrypt cert, and having followed all the guides I kept getting the following error in the logs

OpenSSL Error: error:14037418:SSL routines:ACCEPT_SR_KEY_EXCH:tlsv1 alert unknown ca

OpenSSL Error: error:140370E5:SSL routines:ACCEPT_SR_KEY_EXCH:ssl handshake failure

Socket error on client , disconnecting.

I tried verifying the certs, by installing openssl

openssl verify cert.pem

But all was fine.

I thought I had to download the trusted root CA certificates for Let’s Encrypt and place it somewhere in the Alpine linux system (the base OS of the broker), but I must admit this “somewhere” was not so clear me.

The problem is that the MQTT broker does not know how to verify its own CA before starting the ssl exchange with any client. This is because the CA signing the Let’s Encrypt cert is not yet distributed and bundled by default in to the Alpine Linux system and therefore has to be added manually.

In the Mosquitto MQTT broker configuration, instead of just pointing directly at the chain.pem file I decided to point at the default place where all ca certs should be.

#cafile /mosquitto/config/certs/chain.pem
capath /etc/ssl/certs

And this write up on installing certificates in an Alpine Image to establish Secured Communication (SSL/TLS) really got to the heart of the matter, the cert needs to be copied to a special directory /usr/local/share/ca-certificates/and then you need to run the program update-ca-certificates so it gets placed in the right way into the folder /etc/ssl/certs.

After much head scratching, it all comes down to 2 command lines

cp /mosquitto/config/certs/chain.pem /usr/local/share/ca-certificates/chain.pem

update-ca-certificates

Once done (via a docker-entrypoint.sh command) the container is able to handle the CA issue, and bridging 2 Mosquitto MQTT brokers that are using Let’s Encrypt certificates can be achieved.

Irish Consultation on the next EU research funding programme

March 30th, 2011

This has been cross posted to my TSSG blog.

This was a short 1/2 day workshop I was recently invited to participate in. The Framework Programmes (FP7 and everything before) have to date, been the European Union’s chief instrument for funding research. Preparations for the next programme 2014-2020 (now called Horizon 2020) and the new Common Strategic Framework for Research and Innovation are now underway and the priorities are being discussed at national and European levels. Ireland has the opportunity to influence the direction and balance of European research and so the purpose of this workshop was to provide input to Ireland’s national submission to the European Commission in response to its Green Paper “From Challenges to Opportunities: Towards a Common Strategic Framework for EU Research and Innovation Funding [pdf]”.

This European wide consultation began in February of 2011, with its purpose to collect opinion on the future of research and innovation funding and co-operation into the next decade in Europe.

The paper itself asks (27) questions about how future funding systems might improve on previous ones, whether new mechanisms are needed and how the elements of the funding system should be balanced, which would have a direct effect on the funding allocated to certain schemes.

This Irish national consultation was led by the Advisory Council for Science, Technology and Innovation (ACSTI) and the drive of the workshop was to refine and develop the views gathered so far from the research and innovation communities in Ireland on the questions put in the European Commission’s Green Paper.

The workshop was opened by the chair Professor Anita Maguire were upon the purpose, structure, key themes and issues for discussion was explained.

  • Benefits of being in the Framework Programmes;
  • Making research and innovation funding more attractive and easy to access for participants;
  • Public-private partnerships;
  • Training and exchange schemes;
  • How to best cover the whole innovation cycle;
  • How to strengthen industry participation;

Once this overview was given the room was split into groups and each group was given the task of commenting on a sub-set of the questions, I was in the group for questions 1 -7. While I though the majority of the responses were fine I was a little concerned with the responses to questions 1 and 2, it seems with group I was in thought so too.

We offered feedback, and in some small way I’m glad to see it was considered as the process is now complete and the final Irish submission to the green paper can be read off this link [pdf] changes to questions 1 and 2 afoot.

In fact there were 13 responses from Ireland, Chemical and Physical Sciences Committee of the Royal Irish Academy, Electricity Supply Board, Forfas, Health Research Board, Irish Research Staff Association, Irish Universities Association, Marine Institute, National Committee for Geographical Sciences, Royal Irish Academy, Science Foundation Ireland, University College Dublin, and one from our very own Jim Clarke, Waterford Institute of Technology for which I also offered some input.

While the process can seem long winded, in fact all the opportunities are there to have your spoke in the programme, you just have to take the time to source those opportunities well in advance.

7th concerntation meeting of Future Networks

February 11th, 2011

This entry is cross posted from my TSSG blog.

Okay time is not being kind to me especially when it comes to completing entries for this blog and while February 2011 is already a lifetime away, but given that I was in Brussels directly after the FIRE workshop, I’d like to report on my attendance at the 7th concerntation meeting of Future Networks.

The main part of the plenary was given over to description of Future Networks research towards standardisation activities. The last part of the session was given over to future research topics in the area as identified by Net!Works, ISI, EIFFEL, NEWCOMM++, BINE and EURO-NF. All presentations can be seen off this link.

The second day of this meeting was split into a number of separate plenaries as the Network of the Future projects are organised into three clusters: Future Internet Technologies (FI Cluster), Radio Access and Spectrum (RAS Cluster) and Converged and Optical Networks (CaON Cluster). I attended the FI Cluster, the agenda and presentations of which you can see off of this link.

There were a number of presentation on the economic and user perspective of Inter-ISP traffic optimization, where ETICS, IBBT, SESERV and SMOOTH-IT made presentations on the matter.

I was quite interested in the session on Information and Execution Automation between the Service and Network planes where GEYSERS, MEDIEVAL, ONE, ONEFIT and  UNIVERSELF gave their view points, however I was left a little perplexed that there was no real concensus on the topic and no plan to reach one.

Okay only a few words it really shouldn’t have taken me this long to post it
, but I hope this gives you a quick overview of the EU activities in the area of the Future Internet, with the next big event FIA Budapest in May.

SFI Future Internet workshop

February 8th, 2011

This entry is cross posted from my TSSG blog.

I have found it hard to keep a handle on all the Internet based research happening in Ireland so I jumped at the chance to participate in the recent SFI workshop on the Future Internet. It proved to be a fantastic opportunity to catch up with old aquaintancies and to meet some new researchers in the field.

Now the topic line is a little controversial in that the term Future Internet now means many things to many people however what’s good about the term is that it can act as a nice umbrella term to capture the massive shift in Internet research which is looking for new ways to move, share, find, define and create digital information. Whether this information is for use in Education, Health , Finance Marine or even Agricultural services it was great to see the wealth of situations to which Irish research was being applied to.

To set the context for day early presentations in the workshop highlighted the meaning of the future Internet, the new architectures being discussed at the EU level and some perspectives on the European Future Internet Assembly.

I gave an overview presentaion on this topic, and my slides can be seen here.

Then in ernest a volley of 10 minute presentations were given by

  • Willie Donnelly on “Why the Future Internet?”
  • Stefan Decker on “From Linked Data to Networked Knowledge” and “Real-World Internet (FIA)”.
  • John Kennedy on the “Future Internet – An Intel Perspective”.
  • Pol Mac Aonghusa on “IBM Smart Cities”.
  • John Holland on the “Ericsson view”.
  • Keith Griffin on the “Cisco view”.
  • Fergal Ward on the “Intune view”.
  • Barry Smyth on “The Sensor Web”.
  • Ronan Farrell on the “CTVR Future Internet activities”.
  • Mike Hinchey on “Lero and FI”.
  • Barry O’Sullivan on “4C Future Internet activities”.
  • Steve Gotz on “CNGL and FI”.
  • Padraig Cunningham on “Clique and FI”.
  • Martin Johnsson on “FAME and FI”.
  • David Malone on th “Hamilton Institute Future Internet activities”.
  • Brendan Jennings on “FI Dagstuhl 2011”.

All the slides can be picked up off this SFI FI workshop page.

I found the format perfect 10 mins meant people had to get to point quickly while at the same time give an impression of the depth of research and it has to be said some very interesting solutions are being investigated in Irish research organisations.

Next up was a presentation by the Marine Institute with some use cases to which only Future Internet technologies could be applied. What followed was some discussion on other use cases which would be applicable, and I gave a presentation on upcoming FI PPP use case.

I usually find that the next steps for this type of event are left hanging in the wind however in this case it couldn’t be further from the truth as plans are now afoot for a broader workshop to take place in Q2 of 2011.

EU – Japan Symposium on Future Internet and New Generation Networks

October 22nd, 2010

This entry is cross posted to my TSSG blog.

Directly from finishing my open source session at the 6th Future Networks concertation meeting I headed for the Brussels airport to catch a flight to Tampere, Finland (via Stockholm) for the 3rd EU-Japan Symposium on Future Internet and New Generation Networks.
The flight was easy going, and the stop off in Stockholm was nice as I got to watch some Champions League football and then relax a little in the Starbucks cafe, catching up on some emails.

Tampere is the third largest city in Finland, and the scene for a number of technological innovations, I was told the first test GSM calls were made here. The actual hotel / conference location was set in a picturesque location by a lake.

Tampere outskirts

The event itself started with some high level presentations on EU Digital Policy, the Digital Agenda for Europe and the ICT Paradigm Shift in this decade. I found the presentation Masahiko Tominaga, Vice President, NICT on NwGN R&D Strategy [pdf] the most interesting of these.

On the next break, it was great to get the opportunity to share lunch with Sasi. Now I know Sasi normally only sits a couple of floors away from me, but it’s times like this we really get a chance to discuss at length a whole miriad of topics.

After lunch the event was broken up into sepereate Tracks and I headed for Internet/Network Architectures session. Sasi presented on the emerging generation of symbiotic networks: Federated Communication Systems [pdf] while I took the opportunity to present on RINA, the Recursive Inter Network Architecture, which is based on the work originated by John Day.

What I took from the whole session was the interesting work of Takeshi Usui (NICT/KDDI Laboratories) on the Virtual Network Mobility:Advanced Mobility Management over Network Virtualization [pdf] and Nao Kawanishi (ATR) on his vision of An Open Mobile Communication System with All Strata Virtualization [pdf].

I was pleasantly surprised by the symposium and people I meet at this event and the first sign of snow, which made the long trip back, via bus to Helsinki and then plane via London Heathrow and onto Dublin a worthwhile one.

Bumper FP7 Call Open Day

July 30th, 2009

What a day for open calls on the FP7 site Transport, Space, Socio-economic sciences and Humanities, Energy, Nanosciences, Nanotechnologies, Materials and new Production Technologies, Research Infrastructures, Environment, Food, Agriculture and Fisheries, and Biotechnology Health and my very own favourite Information and Communication Technologies.
So EU FP7 ICT Call 5 is finally open today with a deadline of 26 October 2009 at 17.00.00 (Brussels local time) and an indicative budget: EUR 732 million
FP7- ICT -2009-5 is going to cover

Challenge 1: Pervasive and Trusted Network and Service Infrastructures

ICT 2009.1.1 The Network of the Future
ICT 2009.1.2 Internet of Services, Software & virtualisation
ICT 2009.1.3 Internet of Things and enterprise environments
ICT 2009.1.4 Trustworthy ICT
ICT 2009.1.6 Future Internet Experimental Facility and Experimentally-driven Research
Challenge 3: Components, systems, engineering
ICT 2009.3.1 Nanoelectronics Technology
ICT 2009.3.5 Engineering of Networked Monitoring and Control Systems
ICT 2009.3.7 Photonics
ICT 2009.3.9 Microsystems and Smart Miniaturised Systems
Challenge 4: Digital Libraries and Content
ICT 2009.4.2 Technology- Enhanced Learning
ICT 2009.4.3 Intelligent information management
Future and emerging technologies
ICT 2009.8.4 Human-Computer Confluence
ICT 2009.8.5 Self-Awareness in Autonomic Systems
ICT 2009.8.6 Towards Zero- Power ICT
ICT 2009.8.9 Coordinating Communities, Plans and Actions in FET Proactive Initiatives
ICT 2009.8.10 Identifying new research topics, Assessing emerging global S&T trends in ICT for future FET Proactive initiatives
Horizontal support actions
ICT 2009.9.2 Supplements to support International Cooperation between ongoing projects
ICT 2009.9.5: Supplements to Strengthen Cooperation in ICT R&D in an Enlarged Europe
The competition in this call is going to be massive, you have on avaerage a 16% chance of being successfully from the call and when looking at the stats from EU FP7 Call 4 getting scored above the threshold will not be an easy task!

Adc61a08-7d25-11de-9fe6-000255111976 Blog_this_caption

FP7 ICT Call 4 is over … and out now for Call 5

April 5th, 2009

Photo Credit: jamesdale10 on flickr http://www.flickr.com/photos/31910792@N05/

Speed Partnering EU style

January 22nd, 2009

The ICT Proposers Day 2009 kicks off today and wow what an agenda [pdf]!
ICT Proposers Day 2009, Budapest
In order to browse the site I have found it easier to go straight to the 2009-2010 priorities section and from there work my way through the challenges.
As for the ICT Proposers’ Day 2009 :: Browse ideas section ….. well now I’m finding it hard to tell the wood from the trees!
Well to help out, there are a number of TSSG folks out in Budapest, like Alan offering ideas, and and John presenting our research work.
It should be an interest event.

A perimeter that’s revolutionising mobile communications

August 11th, 2008

The EU FP7 project Perimeter is well an truly up and running now.
EU FP7 project Perimeter
PERIMETER is really attempting to take user-centric strategies to achieve seamless mobility driven by actual user needs, we believe that putting the user at the centre rather than the operator enables the user to control their identity, preferences and credentials, and so seamless mobility is streamlined, enabling mobile users to be “Always Best Connected” in multiple-access multiple-operator networks.
A major part of the TSSG work will be in the testbeds, where we will interconnect with TUB and then help co-create and assess Perimeters middleware components and its integrated applications and services.
Which leads nicely to FIREweek September 10-12th in Paris. An interesting event launched on the 10th with a follow up strategy workshop on the 11th, the week closing out with the 2nd workshop on IMS Enabled Converged Networks: New paradigms for services delivery

Experiences of an Irish Researcher in FP6

September 4th, 2007

On the 18th of July last I was asked to present at an Enterprise Ireland information seminar in Waterford, highlighting the opportunities and support structures for Irish SME’s to become involved in projects within the EU 7th Framework Programme.
As the Framework Programme 7 presents fresh opportunities for SME’s, via the “Capacities Research for the Benefit of SME’s” Programme, to engage with other European partners, this seminar was put in place to provide an opportunity for delegates to hear first hand from experienced framework participants and the opportunity to network amongst their industry and third level peers.
(Can you tell I’ve ripped this blurb from the Agenda text?)
My presentation “Experiences of an Irish Researcher in FP6” can be found on the link provided and is also embedded below.

The event was well attended and I enjoyed giving the presentation. Given that the deadline for FP7-SME-2007-1 just closed an hour ago I thought it might be an idea to release this entry and get people thinking about the next Call.