Skip to content

Conversation

@HuakunShen
Copy link

@HuakunShen HuakunShen commented Dec 9, 2024

Original Issue: #2092

Add skip_ssl_cert_check and trust_ssl_cert options to upload and download function, to skip ssl check or trust a given self signed ssl cert.

Sample Code:

 download(
      "https://localhost:9559/stream-file",
      "/Users/hk/Downloads/test.mp4",
      (progress) => {
        console.log(progress);
      },
      undefined,
      undefined,
      {
        skipSslCertCheck: true,
      }
    ))

My app (https://github.com/kunkunsh/kunkun) includes a local file transfer server. Self-signed cert is used for data encryption, but this plugin doesn't support self-signed cert or skipping SSL check.

Function signatures:

async function download(
  url: string,
  filePath: string,
  progressHandler?: ProgressHandler,
  headers?: Map<string, string>,
  body?: string,
  options?: {
    skipSslCertCheck?: boolean
    trustSslCert?: string
  }
): Promise<void>


async function upload(
  url: string,
  filePath: string,
  progressHandler?: ProgressHandler,
  headers?: Map<string, string>,
  options?: {
    skipSslCertCheck?: boolean
    trustSslCert?: string
  }
): Promise<string> 

@HuakunShen HuakunShen requested a review from a team as a code owner December 9, 2024 07:54
@HuakunShen
Copy link
Author

HuakunShen commented Dec 9, 2024

Another suggestion: an options object field is added to the JS API download() and upload(), which prevents having to use undefined for not used variables. headers and body field should also be added to the options object.
But to keep backward compatibility, I didn't move them in the PR to avoid breaking the API.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2024

Package Changes Through 525f458

There are 2 changes which include log with patch, log-js with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.6 2.0.7
api-example-js 2.0.3 2.0.4
log 2.0.3 2.0.4
log-js 2.0.1 2.0.2

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars FabianLars added the plugin: http-extra Former "upload" plugin label Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: http-extra Former "upload" plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants