Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions core/util/webhunter.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ type Request struct {
basicAuthUsername string
basicAuthPassword string
Context context.Context


//curl only
P12File string
P12Password string
}

func NewRequest(method, url string) *Request {
Expand Down Expand Up @@ -288,6 +293,16 @@ func ExecuteRequestViaCurl(req *Request) (*Result, error) {
args = append(args, "-H", fmt.Sprintf("User-Agent: %s", req.Agent))
}

// Add P12/PFX client certificate
if req.P12File != "" {
if req.P12Password != "" {
args = append(args, "--cert", fmt.Sprintf("%s:%s", req.P12File, req.P12Password))
} else {
args = append(args, "--cert", req.P12File)
}
args = append(args, "--cert-type", "P12")
}

// Add body data
if len(req.Body) > 0 {
// Create temporary file for body content
Expand Down Expand Up @@ -316,6 +331,8 @@ func ExecuteRequestViaCurl(req *Request) (*Result, error) {
// Execute curl command
cmd := exec.Command("curl", args...)

log.Debug(args)

var stdout, stderr bytes.Buffer
cmd.Stdout = &stdout
cmd.Stderr = &stderr
Expand Down
1 change: 1 addition & 0 deletions docs/content.en/docs/release-notes/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Information about release notes of INFINI Framework is provided here.
### 🚀 Features
### 🐛 Bug fix
### ✈️ Improvements
- chore: add p12 cert support to curl #239

## 1.3.0 (2025-11-19)
### ❌ Breaking changes
Expand Down
Loading