Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nng_listener_create tls: Not supported #923

Open
lizziemac opened this issue Apr 18, 2024 · 3 comments
Open

nng_listener_create tls: Not supported #923

lizziemac opened this issue Apr 18, 2024 · 3 comments
Assignees

Comments

@lizziemac
Copy link

lizziemac commented Apr 18, 2024

Describe the bug
I'm upgrading from 0d35a4763e4bb0df0721a5495f6e58bf412f92ee (0.21.5) to 0d35a4763e4bb0df0721a5495f6e58bf412f92ee (0.21.8). On the latest version, it appears TLS is not supported, and I'm getting the following logs:

$ nanomq start
Config file is not specified, use default config file: /etc/nanomq.conf
2024-04-18 18:49:54 [1105] FATAL /usr/src/debug/nanomq/0.21.8-r0/git/nanomq/apps/broker.c:1122 broker: nng_listener_create tls
nng_listener_create tls: Not supported

Expected behavior
I'm able to start the nanomq server while hosting only an SSL listener.

Actual Behavior
I encounter a fatal error.

To Reproduce
Compile nanoMQ for 0.21.8 with -DNNG_ENABLE_TLS=ON -DNNG_ENABLE_SQLITE=ON -DCMAKE_BUILD_TYPE=Debug.

Run NanoMQ with the following in /etc/nanomq.conf

# NanoMQ Configuration 0.18.0

# #============================================================
# # NanoMQ Broker
# #============================================================

mqtt {
    property_size = 32
    max_packet_size = 10KB
    max_mqueue_len = 2048
    retry_interval = 10s
    keepalive_multiplier = 1.25
    
    # Three of below, unsupported now
    max_inflight_window = 2048
    max_awaiting_rel = 10s
    await_rel_timeout = 10s
}

listeners.tcp {
	enable = false
}

listeners.ssl {
	enable = true
	bind = "0.0.0.0:8883"
	keyfile = "/mnt/settings/ssl/camera.key"
	certfile = "/mnt/settings/ssl/camera.crt"
	cacertfile = "/mnt/settings/ssl/root_ca.pem"
	verify_peer = true
	fail_if_no_peer_cert = true
}

listeners.ws {
	enable = false
}

http_server {
	enable = false
}

log {
    to = [file, console]
    level = warn
    dir = "/tmp"
    file = "nanomq.log"
    rotation {
        size = 10MB
        count = 5
    }
}

sqlite {
    disk_cache_size = 10  # Max number of messages for caching
    mounted_file_path="/mnt/media/" # Mounted file path
    flush_mem_threshold = 1   # The threshold number of flushing messages to flash
    resend_interval = 5000    # Resend interval (ms)
}

auth {
    allow_anonymous = true # We don't use a username and password
    no_match = deny
    deny_action = disconnect
    
    cache = {
        max_size = 32
        ttl = 1m
    }
    
    acl = {include "/etc/nanomq_acl.conf"}
}

Environment Details

  • NanoMQ version: 0.21.8
  • Operating system and version: Linux aarch64 - custom with linux kernel of 5.15.120-yocto-standard
  • Compiler and language used: OECMake

Client SDK
N/A

Additional context
This also fails with the default config, when uncommenting the ssl section, and I'm seeing the same error in pre-release 0.21.9

@JaylinYu
Copy link
Member

JaylinYu commented Apr 18, 2024

Whoops, perhaps there is sth wrong with CMake configuration of mebdtls after Garrett made some changes on NNG.
Will look into it now.
BTW, I see you are using Yocto, is nanomq working fine on yocto? I am at EOSS of seattle now, people asking about the compatibility, I assumed it is fine.

@lizziemac
Copy link
Author

Yep, it's building just fine! The args I've provided above are the only ones I'm using and it works like a charm

@StargazerWayne
Copy link
Collaborator

0.21.8 TLS works fine in my platform. Make sure you update both NanoMQ and NanoNNG to 0.21.8

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

No branches or pull requests

3 participants