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

Curve not enabled by default #640

Open
muscleman opened this issue Jul 8, 2024 · 11 comments
Open

Curve not enabled by default #640

muscleman opened this issue Jul 8, 2024 · 11 comments

Comments

@muscleman
Copy link

following some examples of implementing curve on a pub/sub i get cannot set public, secret or server public keys

setting socket.curveserver = true throws exceptions too.

  • OS: [Ubuntu 22.04]
  • ZeroMQ.js version: [6.0.0-beta.20]
@muscleman muscleman added the bug label Jul 8, 2024
@aminya
Copy link
Member

aminya commented Jul 8, 2024

Curve is not included in the prebuilt binaries anymore following the upstream approach. You should build the binaries from the source if that is desired.
Also see,
#638 (comment)

@muscleman
Copy link
Author

muscleman commented Jul 9, 2024

so adding
`
#.npmrc

build_from_source=true
zmq_draft=true
`

and setting
#build.ts -DWITH_LIBSODIUM=ON

is enough to get curve?

@muscleman
Copy link
Author

nope, still want work

@muscleman
Copy link
Author

would be super helpful if someone could do a little documentation on how to turn on curve

@aminya aminya added the 6.x label Aug 13, 2024
@damiDev8
Copy link

damiDev8 commented Sep 9, 2024

@aminya is it planned that curve will be reintegrated into the prebuilt binaries?

@aminya
Copy link
Member

aminya commented Oct 2, 2024

Curve needs to be added to the project prebuilds so it works out of the box.

You can expedite the process by sponsoring the project
https://github.com/sponsors/aminya
https://polar.sh/aminya/
https://www.patreon.com/aminya

@aminya
Copy link
Member

aminya commented Oct 22, 2024

I have migrated the build to CMake/vcpkg. Now you can enable the Curve support through npmrc by building from the source.
https://github.com/zeromq/zeromq.js#curve-support

@aminya aminya added enhancement and removed bug labels Oct 22, 2024
@aminya aminya changed the title Curve not working Curve not enabled by default Oct 22, 2024
@antoncxx
Copy link

Hi, @aminya

Tried installing zeromq with the following .npmrc file:

build_from_source=true
zmq_curve="true"
zmq_sodium="true"

But when I run this snippet [on a ubuntu machine]:

import * as zmq from "zeromq";

try {
  zmq.curveKeyPair();
} catch (err) {
  console.log(err);
}

I get Error: Operation not supported.
Did I miss a step ?

@aminya
Copy link
Member

aminya commented Nov 21, 2024

It should have worked, if it doesn't that's an issue we need to look into. Did it rebuild Zeromq from the source once you did this?

@antoncxx
Copy link

It should have worked, if it doesn't that's an issue we need to look into. Did it rebuild Zeromq from the source once you did this?

I think so. At least the first time I attempted to do npm install zeromq it failed, because I didn't have cmake installed.
Once I installed all the required dependencies, the installation succeeded.

@aminya
Copy link
Member

aminya commented Nov 21, 2024

Ok. Thanks for the report. I'll soon try to add it to the CI and reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants