mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

Loading certificates from memory instead of file path

Open aaronovz1 opened this issue 7 years ago • 7 comments

Is there any reason there isn't a way to load certs from memory? It seems mosquitto_tls_set only takes file paths. If I wanted to store private keys encrypted on storage, I can't decrypt in memory and use with mosquitto, I'd have to store them unencrypted.

aaronovz1 avatar Apr 17 '18 19:04 aaronovz1

Is it possible to get some movement on this enhancement?

aaronovz1 avatar Jul 09 '19 21:07 aaronovz1

This is practical for clients, especially on Windows.

ethsonliu avatar Aug 26 '19 07:08 ethsonliu

@ralight Hi,

libmosq_EXPORT int mosquitto_tls_set(struct mosquitto *mosq,
		const char *cafile, const char *capath,
		const char *certfile, const char *keyfile,
		int (*pw_callback)(char *buf, int size, int rwflag, void *userdata));

Store private-keys and certificates on disk rather than on RAM is dangerous on clients especially on Windows, but if with private-keys encrypted, it will be safe to be public for everyone, right?

ethsonliu avatar Aug 26 '19 08:08 ethsonliu

Yes, I think if encrypted on disk with the client app being able to load it into memory and decrypt and pass the bytes into mosquitto it would be more secure and more robust.

aaronovz1 avatar Sep 10 '19 19:09 aaronovz1

Any update on this? Would be great to have. Allows for better management of a device instance if not tied to the File system.

ChristopherHandy avatar Feb 17 '20 16:02 ChristopherHandy

My approach is to decrypt, start, and then delete

yqzhan avatar Feb 23 '21 07:02 yqzhan