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

Fix certificate issue for internal company setup #1088

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jasonkneen
Copy link

@jasonkneen jasonkneen commented Feb 5, 2025

Fixes #1086

Add logic to handle custom certificates for internal company setup.

  • crates/goose/src/providers/openai.rs

    • Import Certificate from reqwest and fs module.
    • Add logic to load custom certificate from a specified path.
    • Update Client::builder() to include custom certificate configuration if specified.
    • Add OPENAI_CERT_PATH to the list of configuration keys.
  • ui/desktop/src/config.ts

    • Import Certificate from electron and fs module.
    • Add loadCustomCertificate function to load custom certificate from a specified path.

For more details, open the Copilot Workspace session.

Fixes block#1086

Add logic to handle custom certificates for internal company setup.

* **crates/goose/src/providers/openai.rs**
  - Import `Certificate` from `reqwest` and `fs` module.
  - Add logic to load custom certificate from a specified path.
  - Update `Client::builder()` to include custom certificate configuration if specified.
  - Add `OPENAI_CERT_PATH` to the list of configuration keys.

* **ui/desktop/src/config.ts**
  - Import `Certificate` from `electron` and `fs` module.
  - Add `loadCustomCertificate` function to load custom certificate from a specified path.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/block/goose/issues/1086?shareId=XXXX-XXXX-XXXX-XXXX).
@@ -8,3 +11,14 @@ export const getApiUrl = (endpoint: string): string => {
export const getSecretKey = (): string => {
return window.appConfig.get('secretKey');
};

// Function to load custom certificate
export const loadCustomCertificate = (certPath: string): Certificate | null => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we use it somewhere?

let mut client_builder = Client::builder().timeout(Duration::from_secs(600));

if let Some(cert_path) = cert_path {
let cert = fs::read(cert_path)?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better naming? like cert_data

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

Successfully merging this pull request may close these issues.

error sending request for url - error
2 participants