Skip to content

[DEP0064] DeprecationWarning: tls.createSecurePair() is deprecated. Please use tls.TLSSocket instead. #64

@cmegens

Description

@cmegens

Running the basics of this NPM plugin gives this error message. It doesn't allow the code to run fully, so the plugin is quite useless for me as it stands now.

I found the createSecurePair in starttls.js, line 7, but no idea how to fix this...

pair = require('tls').createSecurePair(sslcontext, false);

Also found this, which seems to describe the problem and a solution:
https://nodejs.org/dist/latest-v6.x/docs/api/tls.html#tls_class_securepair
which says:

Note: The tls.createSecurePair() method is now deprecated in favor of tls.TLSSocket(). For example, the code:

pair = tls.createSecurePair(/* ... */);
pair.encrypted.pipe(socket);
socket.pipe(pair.encrypted);

can be replaced by:

secure_socket = tls.TLSSocket(socket, options);
where secure_socket has the same API as pair.cleartext
```.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions