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

feat(Jenkins Node): Add support for self signed certificates #9849

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion packages/nodes-base/credentials/JenkinsApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class JenkinsApi implements ICredentialType {

properties: INodeProperties[] = [
{
displayName: 'Jenking Username',
displayName: 'Jenkins Username',
name: 'username',
type: 'string',
default: '',
Expand All @@ -27,5 +27,12 @@ export class JenkinsApi implements ICredentialType {
type: 'string',
default: '',
},
{
displayName: 'Ignore SSL Issues',
name: 'ignoreSSLIssues',
type: 'boolean',
default: false,
description: 'Whether to connect even if SSL certificate validation is not possible',
},
];
}
1 change: 1 addition & 0 deletions packages/nodes-base/nodes/Jenkins/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export async function jenkinsApiRequest(
json: true,
qs,
body,
rejectUnauthorized: !credentials.ignoreSSLIssues as boolean,
};
options = Object.assign({}, options, option);
try {
Expand Down
5 changes: 4 additions & 1 deletion packages/nodes-base/nodes/Jenkins/Jenkins.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type JenkinsApiCredentials = {
username: string;
apiKey: string;
baseUrl: string;
ignoreSSLIssues: boolean;
};

export class Jenkins implements INodeType {
Expand Down Expand Up @@ -394,7 +395,8 @@ export class Jenkins implements INodeType {
this: ICredentialTestFunctions,
credential: ICredentialsDecrypted,
): Promise<INodeCredentialTestResult> {
const { baseUrl, username, apiKey } = credential.data as JenkinsApiCredentials;
const { baseUrl, username, apiKey, ignoreSSLIssues } =
credential.data as JenkinsApiCredentials;

const url = tolerateTrailingSlash(baseUrl);
const endpoint = '/api/json';
Expand All @@ -409,6 +411,7 @@ export class Jenkins implements INodeType {
qs: {},
uri: `${url}${endpoint}`,
json: true,
rejectUnauthorized: !ignoreSSLIssues,
};

try {
Expand Down