Skip to content

Commit

Permalink
[eas-shared] Add support for self-signed certificates (#208)
Browse files Browse the repository at this point in the history
* [eas-shared] Add support for self-signed certificates

* Add changelog entry
  • Loading branch information
gabrieldonadel authored Nov 3, 2024
1 parent e9eef54 commit 4c638a1
Show file tree
Hide file tree
Showing 5 changed files with 217 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- Add experimental support for Windows and Linux. ([#152](https://github.com/expo/orbit/pull/152), [#157](https://github.com/expo/orbit/pull/157), [#158](https://github.com/expo/orbit/pull/158), [#160](https://github.com/expo/orbit/pull/160), [#161](https://github.com/expo/orbit/pull/161), [#165](https://github.com/expo/orbit/pull/165), [#170](https://github.com/expo/orbit/pull/170), [#171](https://github.com/expo/orbit/pull/171), [#172](https://github.com/expo/orbit/pull/172), [#173](https://github.com/expo/orbit/pull/173), [#174](https://github.com/expo/orbit/pull/174), [#175](https://github.com/expo/orbit/pull/175), [#177](https://github.com/expo/orbit/pull/177), [#178](https://github.com/expo/orbit/pull/178), [#180](https://github.com/expo/orbit/pull/180), [#181](https://github.com/expo/orbit/pull/181), [#182](https://github.com/expo/orbit/pull/182), [#185](https://github.com/expo/orbit/pull/185), [#191](https://github.com/expo/orbit/pull/191) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Automatically select the correct iOS device depending on app type. ([#200](https://github.com/expo/orbit/pull/200) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Add support for self-signed certificates. ([#208](https://github.com/expo/orbit/pull/208) by [@gabrieldonadel](https://github.com/gabrieldonadel))

### 🐛 Bug fixes

Expand Down
1 change: 1 addition & 0 deletions packages/eas-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"node-fetch": "2.6.7",
"querystring": "0.2.0",
"semver": "7.5.2",
"system-ca": "^2.0.1",
"tar": "6.1.13",
"uuid": "9.0.0"
}
Expand Down
7 changes: 7 additions & 0 deletions packages/eas-shared/src/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import fetch, { RequestInfo, RequestInit, Response } from 'node-fetch';
export * from 'node-fetch';
import { systemCertsSync } from 'system-ca';
import https from 'https';

const agent = new https.Agent({
ca: systemCertsSync({ includeNodeCertificates: true }),
});

export class RequestError extends Error {
constructor(
Expand All @@ -12,6 +18,7 @@ export class RequestError extends Error {

export default async function (url: RequestInfo, init?: RequestInit): Promise<Response> {
const response = await fetch(url, {
agent,
...init,
});
if (response.status >= 400) {
Expand Down
2 changes: 1 addition & 1 deletion packages/eas-shared/src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
isMultipartPartWithName,
parseMultipartMixedResponseAsync,
} from '@expo/multipart-body-parser';
import fetch, { Response } from 'node-fetch';
import fetch, { Response } from './fetch';
import { NewManifest } from 'expo-manifests';

export type Manifest = NewManifest;
Expand Down
Loading

0 comments on commit 4c638a1

Please sign in to comment.