Skip to content

Pipeline client sends https:// requests in plaintext #545

Closed

Description

@dwisiswant0

PipelineOptions has no TLS setting, and NewPipelineClient never sets clientpipeline.PipelineClient.IsTLS. As a result, the pipeline client never uses TLS, even for https:// URLs.

package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
	"net/http/httptest"
	"strings"

	"github.com/projectdiscovery/rawhttp"
)

func main() {
	srv := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		_, _ = io.WriteString(w, "ok")
	}))
	srv.Config.ErrorLog = log.New(io.Discard, "", 0)
	srv.StartTLS()
	defer srv.Close()

	opts := rawhttp.DefaultPipelineOptions
	opts.Host = strings.TrimPrefix(srv.URL, "https://")
	client := rawhttp.NewPipelineClient(opts)

	resp, err := client.Get(srv.URL)
	if err != nil {
		fmt.Println("error:", err)
		return
	}
	body, _ := io.ReadAll(resp.Body)
	fmt.Printf("GET %s -> %d %q\n", srv.URL, resp.StatusCode, body)
}

Output with v0.1.92:

GET https://127.0.0.1:42481 -> 400 "Client sent an HTTP request to an HTTPS server.\n"

Expected: 200 "ok".

Activity

  1. self-assigned this
    on Oct 14, 2026
  2. added theissue type on Oct 14, 2026
  3. added
    Type: Bug
    on Oct 14, 2026
  4. added a commit that references this issue on Oct 23, 2026
    301aaa2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: Bug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions