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

Typescript: Missing Type (Buffer) for SSL Configuration (key, cert. ca) for 'ConnectionOptions' type #92

Open
happyoka opened this issue May 17, 2022 · 0 comments

Comments

@happyoka
Copy link

Describe the bug
Type 'Buffer' is not assignable to type 'string'.ts(2322)
connection.d.ts(199, 3): The expected type comes from property 'key' which is declared here on type 'ConnectionOptions'

To Reproduce
Steps to reproduce the behavior:

const connectionOptions : ConnectionOptions = {
    host: '192.168.80.90',
    port: 5671,
    transport: 'tls',
    servername: 'root',
    reconnect: true,
    key: fs.readFileSync(path.resolve(__dirname,'../client.key')),
    cert: fs.readFileSync(path.resolve(__dirname,'../client-cert.pem')),
    ca: fs.readFileSync(path.resolve(__dirname,'../server.pem')),
    rejectUnauthorized: false
 };

Expected behavior
No Linting error or typescript error

Package-version: 2.1.0
node.js version: v16.14.0
OS name and version: Window

Additional context
Add any other context about the problem here.

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

1 participant