mosquitto auth http 安全认证

  • 安装curl依赖
  • 安装mosquitto-auth-plug

安装curl依赖

yum install -y libcurl-dev libcurl-devel

安装mosquitto-auth-plug

下载安装包:https://github.com/jpmens/mosquitto-auth-plug/releases/

wget https://github.com/jpmens/mosquitto-auth-plug/archive/0.1.3.tar.gz
tar -xzvf mosquitto-auth-plug-0.1.3.tar.gz
cd mosquitto-auth-plug-0.1.3
cp config.mk.in config.mk

vim config.mk

# Select your backends from this list
BACKEND_CDB ?= no
BACKEND_MYSQL ?= no
BACKEND_SQLITE ?= no
BACKEND_REDIS ?= no
BACKEND_POSTGRES ?= no
BACKEND_LDAP ?= no
BACKEND_HTTP ?= yes
BACKEND_JWT ?= no
BACKEND_MONGO ?= no
BACKEND_FILES ?= no
BACKEND_MEMCACHED ?= no# Specify the path to the Mosquitto sources here
# MOSQUITTO_SRC = /usr/local/Cellar/mosquitto/1.4.12
MOSQUITTO_SRC = /data/mosquitto# Specify the path the OpenSSL here
OPENSSLDIR = /etc/pki/tls# Add support for django hashers algorithm name
SUPPORT_DJANGO_HASHERS ?= no# Specify optional/additional linker/compiler flags here
# On macOS, add
#       CFG_LDFLAGS = -undefined dynamic_lookup
# as described in https://github.com/eclipse/mosquitto/issues/244
#
# CFG_LDFLAGS = -undefined dynamic_lookup  -L/usr/local/Cellar/openssl/1.0.2l/lib
# CFG_CFLAGS = -I/usr/local/Cellar/openssl/1.0.2l/include -I/usr/local/Cellar/mosquitto/1.4.12/include
CFG_LDFLAGS =
CFG_CFLAGS =

查看openssl的安装目录的方法:

openssl version -a

将mosquitto目录下的config.h复制到 ./src/下一份
修改uthash.h,在uthash.h中添加一行

#define _mosquitto_free(ptr)

接下来执行编译指令(如果之前在使用其他插件时进行过编译,先执行make clean)

make

编译成功会在当前目录下生成auth-plug.so文件,然后将auth-plug.so复制到mosquitto的目录下的plugin中
修改mosquitto的配置文件

allow_anonymous false
auth_plugin /data/mqttbroker/mosquitto/plugin/auth-plug.so
auth_opt_backends http
auth_opt_http_ip 172.30.1.146
auth_opt_http_port 9060
#auth_opt_http_hostname example.org
auth_opt_http_getuser_uri /mosquitto/auth
auth_opt_http_superuser_uri /mosquitto/superuser
auth_opt_http_aclcheck_uri /mosquitto/acl

重启mosquitto

mosquitto auth http 安全认证相关推荐

  1. Mosquitto AUTH认证

    Mosquitto用户认证配置 1.用户参数说明 Mosquitto服务器的配置文件为/etc/mosquitto/mosquitto.conf,关于用户认证的方式和读取的配置都在这个文件中进行配置. ...

  2. Laravel7使用Auth进行用户认证

    laravel7 版本移除了 auth,大家都知道以前版本是直接使用 php artisan make:auth就可以使用,但是这版本不行了,那么要怎么弄呢?今天和大家说一下具体步骤. Laravel ...

  3. 转mosquitto auth plugin 编译配置

    配置使用 mysql 作为 be (back end) 使用config.mk 配置编译参数 cp config.mk.in config.mk 修改 安装 mysql sudo apt-get in ...

  4. hikaridatasource 加密后登陆不上_python测试开发django42.auth模块登陆认证

    前言 在开发一个网站时,经常会用到用户的注册和登陆相关的账号管理功能,auth模块是Django提供的标准权限管理系统,可以提供用户身份认证, 用户组和权限管理. 像用户注册.用户登录.用户认证.注销 ...

  5. emq auth mysql_EMQ X 认证鉴权(一)——基于 MySQL 的 MQTT 连接认证

    前言 安全保护几乎对于所有的项目都是一个挑战,对于物联网项目更是如,自普及应用以来物联网业内已经发生过多起安全事故. 作为物联网通信协议事实标准,MQTT 保持着较高的安全性,提供了多层次的安全设计: ...

  6. Vyos OpenVPN (SSL TLS+User Auth) 本地PAM认证 SSLVPN服务器搭建

    VYOS OpenVPN SSL TLS + User Auth + PAM认证多用户拨入 实现目标 1.安装环境 1.1.证书生成 1.2.用户认证脚本 3.OpenVPN Server配置 3.1 ...

  7. mosquitto mysql_转mosquitto auth plugin 编译配置

    配置使用 mysql 作为 be (back end) 使用config.mk 配置编译参数 cp config.mk.in config.mk 修改 安装 mysql sudo apt-get in ...

  8. django使用auth模块进行身份认证

    https://docs.djangoproject.com/zh-hans/2.0/topics/auth/default/#authentication-in-web-requests djang ...

  9. mod auth mysql_Apache使用mysql认证用户

    使用MySQL进行认证 第1步:下载MySQL认证模块,并更名为mod_auth_mysql.so文件,并保存在apache的modules目录下 第2步:apache要加载此功能模块 LoadMod ...

最新文章

  1. 云平台设计系统,助力业务快速开发
  2. swoole 异步redis
  3. python得到windows自启动列表
  4. 微信小游戏开发Canvas资源汇总
  5. iOS之路9-#import 与#include和 @class的区别
  6. 外包程序员入职蚂蚁金服被质疑,网友:人生污点
  7. CentOs7安装JDK/Tomcat/Git/Gradle
  8. r 保留之前曲线_生存曲线居然能够批量绘制了
  9. 463. 岛屿的周长
  10. 多线程爬虫191023
  11. 让你惊叹的 Markdown 写作工具推荐
  12. [Android Pro] 关于BitmapFactory.decodeStream(is)方法无法正常解码为Bitmap对象的解决方法...
  13. 7.22版本服务器维护,7月22日服务器例行维护公告
  14. 批量取消bilibili关注
  15. Coding and Paper Letter(五十)
  16. 如何将音乐复制到您的Android手机
  17. C# 源代码+ SQLserver数据库点餐软件
  18. Android开发基础入门
  19. linux 查看硬盘空间
  20. 51NOD 1024 矩阵中不重复的元素

热门文章

  1. 呕心沥血之作!最能代表beyond 的二十首歌!(十九)
  2. 并查集(13张图解)--擒贼先擒王
  3. application.properties
  4. vr中的计算机知识,VR技术基本常识
  5. 2019年中国银行三年期大额存单的利率是多少?
  6. 常用的GitHub的搜索筛选条件
  7. OpenCascade Primitives BRep - Box
  8. 华为畅享MAX:巨屏+超大电池冬日窝家追剧新选择
  9. 双目立体匹配之视差优化
  10. 20212126张楷勤#Python技能树测评和CSDN Markdown编译器测评