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

Scripting runtime doesn't respect TLS/SSL settings #2259

Open
2 tasks done
logandavies181 opened this issue May 7, 2024 · 0 comments
Open
2 tasks done

Scripting runtime doesn't respect TLS/SSL settings #2259

logandavies181 opened this issue May 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@logandavies181
Copy link

logandavies181 commented May 7, 2024

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

The options for SSL/TLS verification, as well as the configurable Custom CA Certificate are ignored when running scripts - pre, post and test.

Notably they do use NODE_EXTRA_CA_CERTS via Electron v30.0.0+ #2257

Reproduction steps

Create an HTTPS server in golang:

# create the custom cert
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj "/CN=foo.example.com"

# add an entry to /etc/hosts so we don't get hostname mismatch even though we
# trust the certificate
echo '127.0.0.1  foo.example.com' | sudo tee --append /etc/hosts

# create a quick https server which presents our brand new cert
go mod init test
cat <<EOF > main.go
package main
import (
	"fmt"
	"net/http"
)
func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		fmt.Println("got request")
		fmt.Fprintln(w, "hello world")
	})
	http.ListenAndServeTLS(":8080", "cert.pem", "key.pem", nil)
}
EOF

go run .

Then run the .bru file below

.bru file to reproduce the bug

meta {
  name: foo with axios
  type: http
  seq: 3
}

get {
  url: https://foo.example.com:8080
  body: none
  auth: none

}

script:pre-request {
  const axios = require("axios");
  const resp = await axios({url:"https://foo.example.com:8080"});
  const data = await resp.data;
  console.log(data);
}

Screenshots/Live demo link

Using the above setup:

image

image

image

@logandavies181 logandavies181 added the bug Something isn't working label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant