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

Read in private key contents on connect #1424

Merged
merged 1 commit into from
Jul 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/api/IBMi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CompileTools } from "./CompileTools";
import { CachedServerSettings, GlobalStorage } from './Storage';
import { Tools } from './Tools';
import * as configVars from './configVars';
import { readFileSync } from "fs";

export interface MemberParts extends IBMiMember {
basename: string
Expand Down Expand Up @@ -116,7 +117,11 @@ export default class IBMi {
try {
connectionObject.keepaliveInterval = 35000;
// Make sure we're not passing any blank strings, as node_ssh will try to validate it
if (!connectionObject.privateKey) (connectionObject.privateKey = null);
if (connectionObject.privateKey) {
connectionObject.privateKey = readFileSync(connectionObject.privateKey, {encoding: `utf-8`});
} else {
connectionObject.privateKey = null;
}

configVars.replaceAll(connectionObject);

Expand Down