Net::M...e::SSL(3pm)

πŸ’– Net::MQTT::Simple::SSL β€” the manual, but make it cute πŸ’–

okay bestie, welcome to the Net::MQTT::Simple::SSL page, perl v5.40.1 vibes, from the User Contributed Perl Documentation corner of the internet. it's a minimal MQTT version 3 interface with SSL support and it's giving secure little messenger πŸ¦‹πŸ”


✨ NAME ✨

Net::MQTT::Simple::SSL β€” minimal MQTT version 3 interface, but with SSL support πŸ’…


🌸 SYNOPSIS 🌸

first up: you can just drop your SSL params into environment variables and let the vibes carry them 🌈

# Specifying SSL parameters in environment variables

export MQTT_SIMPLE_SSL_CA=/etc/ssl/ca.crt
export MQTT_SIMPLE_SSL_CERT=/etc/ssl/mqtt.crt
export MQTT_SIMPLE_SSL_KEY=/etc/ssl/mqtt.key

perl -MNet::MQTT::Simple::SSL=mosquitto.example.org \
     -nle'retain "topic/here" => $_'

or, if you're a main character who likes things explicit ✨:

# Specifying explicit SSL parameters

use Net::MQTT::Simple::SSL;

my $mqtt = Net::MQTT::Simple::SSL->new("mosquitto.example.org", {
    SSL_ca_file   => '/etc/ssl/ca.crt',
    SSL_cert_file => '/etc/ssl/mqtt.crt',
    SSL_key_file  => '/etc/ssl/mqtt.key',
});

$mqtt->publish("topic/here" => "Message here");
$mqtt->retain( "topic/here" => "Message here");
no cap, both paths work. pick your fighter πŸ’œ

πŸŽ€ DESCRIPTION πŸŽ€

so basically: this is a subclass of Net::MQTT::Simple that adds SSL/TLS on top. glow-up complete πŸ‘‘

like its base class, you can hand it a server right on the "use" line β€” and when you do, "publish" and "retain" get exported so you can use them as the simplest little functions ever. 🫢

the thing is though: that "use"-line interface supports configuration via environment variables, but not via explicit options in code. it said no to the code-options invite, respectfully. 😭

the object oriented interface, however, does support explicit SSL configuration. so if you want the full menu of options you can hand to the constructor, "new", go look at IO::Socket::SSL β€” it has the comprehensive overview, iykyk. πŸ‘‘


🌼 Environment variables 🌼

instead of spelling out the SSL options in the constructor, you can set them with environment variables. and listen: these get overridden by any options you give to "new". constructor wins, always, periodt. πŸ’…

  • MQTT_SIMPLE_SSL_INSECURE β€” set this to something other than 0 to disable SSL validation. 🚨 (yes, like all "insecure" switches, this is the spicy one, be careful bestie)
  • MQTT_SIMPLE_SSL_CA β€” the path to the CA certificate, or to a directory of certificates. on some systems IO::Socket::SSL can find the CA path automatically all by itself, little overachiever 🧚
  • MQTT_SIMPLE_SSL_CERT β€” path to the client certificate file.
  • MQTT_SIMPLE_SSL_KEY β€” path to its key file. (MQTT_SIMPLE_SSL_CERT and MQTT_SIMPLE_SSL_KEY are two halves of one iconic duo, fr fr πŸ”‘)

πŸ“œ LICENSE πŸ“œ

this software may be redistributed under the terms of the GPL, LGPL, modified BSD, or Artistic license, or any of the other OSI approved licenses listed at http://www.opensource.org/licenses/alphabetical. 🌈

distribution is allowed under all of these licenses, or any smaller subset of multiple or just one of these licenses. so many options, so much freedom, we love to see it ✨

when you're using a packaged version, please check the package metadata to see under which license terms it was distributed. alternatively, a distributor may choose to replace the LICENSE section of the documentation and/or include a LICENSE file to reflect the license(s) they chose to redistribute under. (tl;dr: read the metadata, bestie, it's giving due diligence πŸ’œ)


πŸ‘‘ AUTHOR πŸ‘‘

Juerd Waalboer <juerd@tnx.nl> β€” thank you for your service, legend 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

  • Net::MQTT::Simple

and that's the whole page, bestie β€” slayed, secured, and documented πŸ’–βœ¨πŸŒΈ

cute little sign-off: this was the Net::MQTT::Simple::SSL manual page for perl v5.40.1, dated 2025-12-22, rendered in your friendly neighborhood terminal. bye bestie, go publish something πŸ”₯πŸŽ€

πŸ“¦ where this page comes from