Compare commits
31 Commits
05fe1df8aa
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f3068f82f3 | |||
|
|
a8dc2ed046 | ||
| 9a3965243c | |||
| 23c2a58c2b | |||
| 45fb6d061d | |||
| c0784fc890 | |||
| 499accf440 | |||
| 6b95ad37c5 | |||
| 54a6044083 | |||
| 0f897ab1b3 | |||
| 0d910ca181 | |||
| 9a63550863 | |||
| eb7a9e6098 | |||
|
|
8585e7649c | ||
| 55e2a9c68e | |||
| 445ab7a8f4 | |||
| 33129d82fd | |||
| c0d095e57b | |||
| e40f3037d3 | |||
| 77d92dbcf9 | |||
| 1da4f6751e | |||
| 3ebfdc06c0 | |||
| d8b342ca3f | |||
| df23fd618a | |||
| 19452f45c2 | |||
| 711a7cc15c | |||
| 58cabadc44 | |||
| 77186c88dd | |||
| 2036d0165b | |||
| 40dd3aa20b | |||
| 00df0cad99 |
@@ -1,6 +1,6 @@
|
||||
This library is fully staticly linked. There should be no external dependencies.
|
||||
|
||||
When building, use build.sh, not make.
|
||||
When building, use build.sh, not make. When building for tests use build.sh -t
|
||||
|
||||
When making TUI menus, try to use the first leter of the command and the key to press to execute that command. For example, if the command is "Open file" try to use a keypress of "o" upper or lower case to signal to open the file. Use this instead of number keyed menus when possible. In the command, the letter should be underlined that signifies the command.
|
||||
|
||||
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -7,10 +7,9 @@ nips/
|
||||
node_modules/
|
||||
nostr-tools/
|
||||
tiny-AES-c/
|
||||
blossom/
|
||||
ndk/
|
||||
|
||||
|
||||
|
||||
secp256k1/
|
||||
Trash/debug_tests/
|
||||
node_modules/
|
||||
|
||||
@@ -20,4 +19,3 @@ node_modules/
|
||||
*.dylib
|
||||
*.dll
|
||||
build/
|
||||
|
||||
|
||||
@@ -1,223 +0,0 @@
|
||||
# NOSTR Core Library - Automatic Versioning System
|
||||
|
||||
## Overview
|
||||
|
||||
The NOSTR Core Library now features an automatic version increment system that automatically increments the patch version (e.g., v0.2.0 → v0.2.1) with each build. This ensures consistent versioning and traceability across builds.
|
||||
|
||||
## How It Works
|
||||
|
||||
### Version Format
|
||||
The library uses semantic versioning with the format: `vMAJOR.MINOR.PATCH`
|
||||
|
||||
- **MAJOR**: Incremented for breaking changes (manual)
|
||||
- **MINOR**: Incremented for new features (manual)
|
||||
- **PATCH**: Incremented automatically with each build
|
||||
|
||||
### Automatic Increment Process
|
||||
|
||||
1. **Version Detection**: The build system scans all git tags matching `v*.*.*` pattern
|
||||
2. **Highest Version**: Uses `sort -V` to find the numerically highest version (not chronologically latest)
|
||||
3. **Patch Increment**: Increments the patch number by 1
|
||||
4. **Git Tag Creation**: Creates a new git tag for the incremented version
|
||||
5. **File Generation**: Generates `nostr_core/version.h` and `nostr_core/version.c` with build metadata
|
||||
|
||||
### Generated Files
|
||||
|
||||
The system automatically generates two files during each build:
|
||||
|
||||
#### `nostr_core/version.h`
|
||||
```c
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 1
|
||||
#define VERSION_STRING "0.2.1"
|
||||
#define VERSION_TAG "v0.2.1"
|
||||
|
||||
#define BUILD_DATE "2025-08-09"
|
||||
#define BUILD_TIME "10:42:45"
|
||||
#define BUILD_TIMESTAMP "2025-08-09 10:42:45"
|
||||
|
||||
#define GIT_HASH "ca6b475"
|
||||
#define GIT_BRANCH "master"
|
||||
|
||||
// API functions
|
||||
const char* nostr_core_get_version(void);
|
||||
const char* nostr_core_get_version_full(void);
|
||||
const char* nostr_core_get_build_info(void);
|
||||
```
|
||||
|
||||
#### `nostr_core/version.c`
|
||||
Contains the implementation of the version API functions.
|
||||
|
||||
## Usage
|
||||
|
||||
### Building with Auto-Versioning
|
||||
|
||||
All major build targets automatically increment the version:
|
||||
|
||||
```bash
|
||||
# Build static library (increments version)
|
||||
./build.sh lib
|
||||
|
||||
# Build shared library (increments version)
|
||||
./build.sh shared
|
||||
|
||||
# Build all libraries (increments version)
|
||||
./build.sh all
|
||||
|
||||
# Build examples (increments version)
|
||||
./build.sh examples
|
||||
|
||||
# Install to system (increments version)
|
||||
./build.sh install
|
||||
```
|
||||
|
||||
### Non-Versioned Builds
|
||||
|
||||
Some targets do not increment versions:
|
||||
|
||||
```bash
|
||||
# Clean build artifacts (no version increment)
|
||||
./build.sh clean
|
||||
|
||||
# Run tests (no version increment)
|
||||
./build.sh test
|
||||
```
|
||||
|
||||
### Using Version Information in Code
|
||||
|
||||
```c
|
||||
#include "version.h"
|
||||
|
||||
// Get version string
|
||||
printf("Version: %s\n", nostr_core_get_version());
|
||||
|
||||
// Get full version with timestamp and commit
|
||||
printf("Full: %s\n", nostr_core_get_version_full());
|
||||
|
||||
// Get detailed build information
|
||||
printf("Build: %s\n", nostr_core_get_build_info());
|
||||
|
||||
// Use version macros
|
||||
#if VERSION_MAJOR >= 1
|
||||
// Use new API
|
||||
#else
|
||||
// Use legacy API
|
||||
#endif
|
||||
```
|
||||
|
||||
### Testing Version System
|
||||
|
||||
A version test example is provided:
|
||||
|
||||
```bash
|
||||
# Build and run version test
|
||||
gcc -I. -Inostr_core examples/version_test.c -o examples/version_test ./libnostr_core.a ./secp256k1/.libs/libsecp256k1.a -lm
|
||||
./examples/version_test
|
||||
```
|
||||
|
||||
## Version History Tracking
|
||||
|
||||
### View All Versions
|
||||
```bash
|
||||
# List all version tags
|
||||
git tag --list
|
||||
|
||||
# View version history
|
||||
git log --oneline --decorate --graph
|
||||
```
|
||||
|
||||
### Current Version
|
||||
```bash
|
||||
# Check current version
|
||||
cat VERSION
|
||||
|
||||
# Or check the latest git tag
|
||||
git describe --tags --abbrev=0
|
||||
```
|
||||
|
||||
## Manual Version Management
|
||||
|
||||
### Major/Minor Version Bumps
|
||||
|
||||
For major or minor version changes, manually create the appropriate tag:
|
||||
|
||||
```bash
|
||||
# For a minor version bump (new features)
|
||||
git tag v0.3.0
|
||||
|
||||
# For a major version bump (breaking changes)
|
||||
git tag v1.0.0
|
||||
```
|
||||
|
||||
The next build will automatically increment from the new base version.
|
||||
|
||||
### Resetting Version
|
||||
|
||||
To reset or fix version numbering:
|
||||
|
||||
```bash
|
||||
# Delete incorrect tags (if needed)
|
||||
git tag -d v0.2.1
|
||||
git push origin --delete v0.2.1
|
||||
|
||||
# Create correct base version
|
||||
git tag v0.2.0
|
||||
|
||||
# Next build will create v0.2.1
|
||||
```
|
||||
|
||||
## Integration Notes
|
||||
|
||||
### Makefile Integration
|
||||
- The `version.c` file is automatically included in `LIB_SOURCES`
|
||||
- Version files are compiled and linked with the library
|
||||
- Clean targets remove generated version object files
|
||||
|
||||
### Git Integration
|
||||
- Version files (`version.h`, `version.c`) are excluded from git via `.gitignore`
|
||||
- Only version tags and the `VERSION` file are tracked
|
||||
- Build system works in any git repository with version tags
|
||||
|
||||
### Build System Integration
|
||||
- Version increment is integrated directly into `build.sh`
|
||||
- No separate scripts or external dependencies required
|
||||
- Self-contained and portable across systems
|
||||
|
||||
## Example Output
|
||||
|
||||
When building, you'll see output like:
|
||||
|
||||
```
|
||||
[INFO] Incrementing version...
|
||||
[INFO] Current version: v0.2.0
|
||||
[INFO] New version: v0.2.1
|
||||
[SUCCESS] Created new version tag: v0.2.1
|
||||
[SUCCESS] Generated version.h and version.c
|
||||
[SUCCESS] Updated VERSION file to 0.2.1
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Version Not Incrementing
|
||||
- Ensure you're in a git repository
|
||||
- Check that git tags exist with `git tag --list`
|
||||
- Verify tag format matches `v*.*.*` pattern
|
||||
|
||||
### Tag Already Exists
|
||||
If a tag already exists, the build will continue with the existing version:
|
||||
|
||||
```
|
||||
[WARNING] Tag v0.2.1 already exists - using existing version
|
||||
```
|
||||
|
||||
### Missing Git Information
|
||||
If git is not available, version files will show "unknown" for git hash and branch.
|
||||
|
||||
## Benefits
|
||||
|
||||
1. **Automatic Traceability**: Every build has a unique version
|
||||
2. **Build Metadata**: Includes timestamp, git commit, and branch information
|
||||
3. **API Integration**: Version information accessible via C API
|
||||
4. **Zero Maintenance**: No manual version file editing required
|
||||
5. **Git Integration**: Automatic git tag creation for version history
|
||||
@@ -1,309 +0,0 @@
|
||||
# Exportable C NOSTR Library Design Guide
|
||||
|
||||
This document outlines the design principles and structure for making the C NOSTR library easily exportable and reusable across multiple projects.
|
||||
|
||||
## Overview
|
||||
|
||||
The C NOSTR library is designed as a modular, self-contained implementation that can be easily integrated into other projects while maintaining compatibility with the broader NOSTR ecosystem.
|
||||
|
||||
## Design Principles
|
||||
|
||||
### 1. Modular Architecture
|
||||
- **Core Layer**: Essential NOSTR functionality (`nostr_core.c/h`)
|
||||
- **Crypto Layer**: Self-contained cryptographic primitives (`nostr_crypto.c/h`)
|
||||
- **WebSocket Layer**: Optional networking functionality (`nostr_websocket/`)
|
||||
- **Dependencies**: Minimal external dependencies (only cJSON and mbedTLS)
|
||||
|
||||
### 2. Clean API Surface
|
||||
- Consistent function naming with `nostr_` prefix
|
||||
- Clear return codes using `NOSTR_SUCCESS`/`NOSTR_ERROR_*` constants
|
||||
- Well-documented function signatures
|
||||
- No global state where possible
|
||||
|
||||
### 3. Self-Contained Crypto
|
||||
- Custom implementations of SHA-256, HMAC, secp256k1
|
||||
- BIP39 wordlist embedded in code
|
||||
- No external crypto library dependencies for core functionality
|
||||
- Optional mbedTLS integration for enhanced security
|
||||
|
||||
### 4. Cross-Platform Compatibility
|
||||
- Standard C99 code
|
||||
- Platform-specific code isolated in separate modules
|
||||
- ARM64 and x86_64 tested builds
|
||||
- Static library compilation support
|
||||
|
||||
## Library Structure
|
||||
|
||||
```
|
||||
c_nostr/
|
||||
├── nostr_core.h # High-level API
|
||||
├── nostr_core.c # Implementation
|
||||
├── nostr_crypto.h # Crypto primitives API
|
||||
├── nostr_crypto.c # Self-contained crypto
|
||||
├── libnostr_core.a # Static library (x86_64)
|
||||
├── libnostr_core.so # Shared library (x86_64)
|
||||
├── cjson/ # JSON parsing (vendored)
|
||||
├── mbedtls/ # Optional crypto backend
|
||||
├── examples/ # Usage examples
|
||||
├── tests/ # Test suites
|
||||
└── nostr_websocket/ # Optional WebSocket layer
|
||||
```
|
||||
|
||||
## Integration Methods
|
||||
|
||||
### Method 1: Static Library Linking
|
||||
|
||||
**Best for**: Applications that want a single binary with all NOSTR functionality embedded.
|
||||
|
||||
```bash
|
||||
# Build the library
|
||||
make lib
|
||||
|
||||
# In your project Makefile:
|
||||
CFLAGS += -I/path/to/c_nostr
|
||||
LDFLAGS += -L/path/to/c_nostr -lnostr_core -lm -static
|
||||
```
|
||||
|
||||
**Usage:**
|
||||
```c
|
||||
#include "nostr_core.h"
|
||||
|
||||
int main() {
|
||||
if (nostr_init() != NOSTR_SUCCESS) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char private_key[32], public_key[32];
|
||||
nostr_generate_keypair(private_key, public_key);
|
||||
|
||||
cJSON* event = nostr_create_text_event("Hello NOSTR!", private_key);
|
||||
// ... use event
|
||||
|
||||
nostr_cleanup();
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### Method 2: Source Code Integration
|
||||
|
||||
**Best for**: Applications that want to customize the crypto backend or minimize dependencies.
|
||||
|
||||
```bash
|
||||
# Copy essential files to your project:
|
||||
cp nostr_core.{c,h} your_project/src/
|
||||
cp nostr_crypto.{c,h} your_project/src/
|
||||
cp -r cjson/ your_project/src/
|
||||
```
|
||||
|
||||
**Compile with your project:**
|
||||
```c
|
||||
// In your source
|
||||
#include "nostr_core.h"
|
||||
// Use NOSTR functions directly
|
||||
```
|
||||
|
||||
### Method 3: Git Submodule
|
||||
|
||||
**Best for**: Projects that want to track upstream changes and contribute back.
|
||||
|
||||
```bash
|
||||
# In your project root:
|
||||
git submodule add https://github.com/yourorg/c_nostr.git deps/c_nostr
|
||||
git submodule update --init --recursive
|
||||
|
||||
# In your Makefile:
|
||||
CFLAGS += -Ideps/c_nostr
|
||||
LDFLAGS += -Ldeps/c_nostr -lnostr_core
|
||||
```
|
||||
|
||||
### Method 4: Shared Library
|
||||
|
||||
**Best for**: System-wide installation or multiple applications sharing the same NOSTR implementation.
|
||||
|
||||
```bash
|
||||
# Install system-wide
|
||||
sudo make install
|
||||
|
||||
# In your project:
|
||||
CFLAGS += $(pkg-config --cflags nostr_core)
|
||||
LDFLAGS += $(pkg-config --libs nostr_core)
|
||||
```
|
||||
|
||||
## API Design for Exportability
|
||||
|
||||
### Consistent Error Handling
|
||||
```c
|
||||
typedef enum {
|
||||
NOSTR_SUCCESS = 0,
|
||||
NOSTR_ERROR_INVALID_INPUT = -1,
|
||||
NOSTR_ERROR_CRYPTO_FAILED = -2,
|
||||
NOSTR_ERROR_MEMORY_ALLOCATION = -3,
|
||||
NOSTR_ERROR_JSON_PARSE = -4,
|
||||
NOSTR_ERROR_NETWORK = -5
|
||||
} nostr_error_t;
|
||||
|
||||
const char* nostr_strerror(int error_code);
|
||||
```
|
||||
|
||||
### Clean Resource Management
|
||||
```c
|
||||
// Always provide cleanup functions
|
||||
int nostr_init(void);
|
||||
void nostr_cleanup(void);
|
||||
|
||||
// JSON objects returned should be freed by caller
|
||||
cJSON* nostr_create_text_event(const char* content, const unsigned char* private_key);
|
||||
// Caller must call cJSON_Delete(event) when done
|
||||
```
|
||||
|
||||
### Optional Features
|
||||
```c
|
||||
// Compile-time feature toggles
|
||||
#ifndef NOSTR_DISABLE_WEBSOCKETS
|
||||
int nostr_connect_relay(const char* url);
|
||||
#endif
|
||||
|
||||
#ifndef NOSTR_DISABLE_IDENTITY_PERSISTENCE
|
||||
int nostr_save_identity(const unsigned char* private_key, const char* password, int account);
|
||||
#endif
|
||||
```
|
||||
|
||||
## Configuration System
|
||||
|
||||
### Build-Time Configuration
|
||||
```c
|
||||
// nostr_config.h (generated during build)
|
||||
#define NOSTR_VERSION "1.0.0"
|
||||
#define NOSTR_HAS_MBEDTLS 1
|
||||
#define NOSTR_HAS_WEBSOCKETS 1
|
||||
#define NOSTR_STATIC_BUILD 1
|
||||
```
|
||||
|
||||
### Runtime Configuration
|
||||
```c
|
||||
typedef struct {
|
||||
int log_level;
|
||||
char* identity_file_path;
|
||||
int default_account;
|
||||
int enable_networking;
|
||||
} nostr_config_t;
|
||||
|
||||
int nostr_set_config(const nostr_config_t* config);
|
||||
const nostr_config_t* nostr_get_config(void);
|
||||
```
|
||||
|
||||
## Testing and Validation
|
||||
|
||||
### Ecosystem Compatibility Testing
|
||||
The library includes comprehensive test suites that validate compatibility with reference implementations like `nak`:
|
||||
|
||||
```bash
|
||||
# Run all tests
|
||||
cd tests && make test
|
||||
|
||||
# Test specific functionality
|
||||
make test-crypto # Cryptographic primitives
|
||||
make test-core # High-level NOSTR functions
|
||||
```
|
||||
|
||||
### Test Vectors
|
||||
Real-world test vectors are generated using `nak` to ensure ecosystem compatibility:
|
||||
- Key generation and derivation (BIP39/BIP32)
|
||||
- Event creation and signing
|
||||
- Bech32 encoding/decoding
|
||||
- Message serialization
|
||||
|
||||
## Documentation for Exporters
|
||||
|
||||
### Essential Files Checklist
|
||||
For projects integrating this library, you need:
|
||||
|
||||
**Core Files (Required):**
|
||||
- `nostr_core.h` - Main API
|
||||
- `nostr_core.c` - Implementation
|
||||
- `nostr_crypto.h` - Crypto API
|
||||
- `nostr_crypto.c` - Self-contained crypto
|
||||
- `cjson/` directory - JSON parsing
|
||||
|
||||
**Optional Files:**
|
||||
- `nostr_websocket/` - WebSocket relay support
|
||||
- `mbedtls/` - Enhanced crypto backend
|
||||
- `examples/` - Usage examples
|
||||
- `tests/` - Validation tests
|
||||
|
||||
### Minimal Integration Example
|
||||
```c
|
||||
// minimal_nostr.c - Smallest possible integration
|
||||
#include "nostr_core.h"
|
||||
|
||||
int main() {
|
||||
// Initialize library
|
||||
nostr_init();
|
||||
|
||||
// Generate keypair
|
||||
unsigned char priv[32], pub[32];
|
||||
nostr_generate_keypair(priv, pub);
|
||||
|
||||
// Create and sign event
|
||||
cJSON* event = nostr_create_text_event("Hello from my app!", priv);
|
||||
char* json_string = cJSON_Print(event);
|
||||
printf("Event: %s\n", json_string);
|
||||
|
||||
// Cleanup
|
||||
free(json_string);
|
||||
cJSON_Delete(event);
|
||||
nostr_cleanup();
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
**Compile:**
|
||||
```bash
|
||||
gcc -I. minimal_nostr.c nostr_core.c nostr_crypto.c cjson/cJSON.c -lm -o minimal_nostr
|
||||
```
|
||||
|
||||
## Future Considerations
|
||||
|
||||
### Language Bindings
|
||||
The C library is designed to be easily wrapped:
|
||||
- **Python**: Use ctypes or cffi
|
||||
- **JavaScript**: Use Node.js FFI or WASM compilation
|
||||
- **Go**: Use cgo
|
||||
- **Rust**: Use bindgen for FFI bindings
|
||||
|
||||
### WebAssembly Support
|
||||
The library can be compiled to WebAssembly for browser usage:
|
||||
```bash
|
||||
emcc -O3 -s WASM=1 -s EXPORTED_FUNCTIONS='["_nostr_init", "_nostr_generate_keypair"]' \
|
||||
nostr_core.c nostr_crypto.c cjson/cJSON.c -o nostr.wasm
|
||||
```
|
||||
|
||||
### Package Manager Support
|
||||
Future versions may include:
|
||||
- pkgconfig files for system installation
|
||||
- CMake integration for easier builds
|
||||
- vcpkg/Conan package definitions
|
||||
|
||||
## Contributing Back
|
||||
|
||||
Projects using this library are encouraged to:
|
||||
1. Report compatibility issues
|
||||
2. Submit test vectors from their use cases
|
||||
3. Contribute performance improvements
|
||||
4. Add support for additional NIPs
|
||||
|
||||
## Version Compatibility
|
||||
|
||||
The library follows semantic versioning:
|
||||
- **Major**: Breaking API changes
|
||||
- **Minor**: New features, backward compatible
|
||||
- **Patch**: Bug fixes
|
||||
|
||||
API stability guarantees:
|
||||
- All functions prefixed with `nostr_` are part of the stable API
|
||||
- Internal functions (static or prefixed with `_`) may change
|
||||
- Configuration structures may be extended but not modified
|
||||
|
||||
---
|
||||
|
||||
This design ensures the C NOSTR library can be easily adopted by other projects while maintaining high compatibility with the NOSTR ecosystem standards.
|
||||
@@ -1,29 +0,0 @@
|
||||
# c-nostr Export and Implementation Guide
|
||||
|
||||
## Overview
|
||||
|
||||
This guide provides essential information for developers using the `c-nostr` library, particularly regarding the capabilities and limitations of its self-contained modules, such as the HTTP client.
|
||||
|
||||
## HTTP Client (`http_client.c`)
|
||||
|
||||
The `http_client` module is a lightweight, self-contained HTTP/HTTPS client designed for simple and direct web requests. It is ideal for tasks like fetching NIP-11 information from Nostr relays or interacting with standard, permissive web APIs.
|
||||
|
||||
### Key Features
|
||||
|
||||
* **Self-Contained**: It is built with `mbedTLS` and has no external dependencies beyond standard C libraries, making it highly portable.
|
||||
* **Simplicity**: It provides a straightforward `http_get()` function for making web requests.
|
||||
* **TLS Support**: It supports HTTPS and basic TLS 1.3/1.2 features, including SNI (Server Name Indication) and ALPN (Application-Layer Protocol Negotiation).
|
||||
|
||||
### Limitations
|
||||
|
||||
The `http_client` is intentionally simple and is **not a full-featured web browser**. Due to its minimalist design, it will likely be blocked by websites that employ advanced anti-bot protection systems.
|
||||
|
||||
* **Incompatibility with Advanced Bot Protection**: Sites like Google, Cloudflare, and others use sophisticated fingerprinting techniques to distinguish between real browsers and automated clients. They analyze the exact combination of TLS cipher suites, TLS extensions, and HTTP headers. Our client's fingerprint does not match a standard browser, so these sites will preemptively drop the connection, typically resulting in a `HTTP_ERROR_NETWORK` error.
|
||||
|
||||
* **Intended Use Case**: This client is best suited for interacting with known, friendly APIs and Nostr relays. It is **not** designed for general web scraping or for accessing services that are heavily guarded against automated traffic.
|
||||
|
||||
### Best Practices
|
||||
|
||||
* **Use for APIs and Relays**: Rely on this client for fetching data from well-defined, public endpoints that do not have aggressive bot-detection measures in place.
|
||||
* **Avoid Protected Sites**: Do not attempt to use this client to access services like Google Search, as such attempts will fail. For those use cases, a full-featured library like `libcurl` or a dedicated web-scraping framework is required.
|
||||
* **Check the Test Suite**: The `tests/http_client_test.c` file contains test cases that demonstrate both the successful use cases (e.g., `httpbin.org`) and the expected failures (e.g., `google.com`), providing a clear reference for the client's capabilities.
|
||||
@@ -1,361 +0,0 @@
|
||||
# Generic Automatic Version Increment System for Any Repository
|
||||
|
||||
Here's a generalized implementation guide for adding automatic versioning to any project:
|
||||
|
||||
## Core Concept
|
||||
**Automatic patch version increment with each build** - Every build automatically increments the patch version: v0.1.0 → v0.1.1 → v0.1.2, etc.
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
### 1. Add Version Increment Function to Build Script
|
||||
Add this function to your build script (bash example):
|
||||
|
||||
```bash
|
||||
# Function to automatically increment version
|
||||
increment_version() {
|
||||
echo "[INFO] Incrementing version..."
|
||||
|
||||
# Check if we're in a git repository
|
||||
if ! git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
echo "[WARNING] Not in a git repository - skipping version increment"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Get the highest version tag (not chronologically latest)
|
||||
LATEST_TAG=$(git tag -l 'v*.*.*' | sort -V | tail -n 1 || echo "v0.1.0")
|
||||
if [[ -z "$LATEST_TAG" ]]; then
|
||||
LATEST_TAG="v0.1.0"
|
||||
fi
|
||||
|
||||
# Extract version components (remove 'v' prefix)
|
||||
VERSION=${LATEST_TAG#v}
|
||||
|
||||
# Parse major.minor.patch using regex
|
||||
if [[ $VERSION =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
|
||||
MAJOR=${BASH_REMATCH[1]}
|
||||
MINOR=${BASH_REMATCH[2]}
|
||||
PATCH=${BASH_REMATCH[3]}
|
||||
else
|
||||
echo "[ERROR] Invalid version format in tag: $LATEST_TAG"
|
||||
echo "[ERROR] Expected format: v0.1.0"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Increment patch version
|
||||
NEW_PATCH=$((PATCH + 1))
|
||||
NEW_VERSION="v${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||
|
||||
echo "[INFO] Current version: $LATEST_TAG"
|
||||
echo "[INFO] New version: $NEW_VERSION"
|
||||
|
||||
# Create new git tag
|
||||
if git tag "$NEW_VERSION" 2>/dev/null; then
|
||||
echo "[SUCCESS] Created new version tag: $NEW_VERSION"
|
||||
else
|
||||
echo "[WARNING] Tag $NEW_VERSION already exists - using existing version"
|
||||
NEW_VERSION=$LATEST_TAG
|
||||
fi
|
||||
|
||||
# Update VERSION file for compatibility
|
||||
echo "${NEW_VERSION#v}" > VERSION
|
||||
echo "[SUCCESS] Updated VERSION file to ${NEW_VERSION#v}"
|
||||
}
|
||||
```
|
||||
|
||||
### 2. Generate Version Header Files (For C/C++ Projects)
|
||||
Add this to the increment_version function:
|
||||
|
||||
```bash
|
||||
# Generate version.h header file (adjust path as needed)
|
||||
cat > src/version.h << EOF
|
||||
/*
|
||||
* Auto-Generated Version Header
|
||||
* DO NOT EDIT THIS FILE MANUALLY - Generated by build script
|
||||
*/
|
||||
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
#define VERSION_MAJOR ${MAJOR}
|
||||
#define VERSION_MINOR ${MINOR}
|
||||
#define VERSION_PATCH ${NEW_PATCH}
|
||||
#define VERSION_STRING "${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||
#define VERSION_TAG "${NEW_VERSION}"
|
||||
|
||||
/* Build information */
|
||||
#define BUILD_DATE "$(date +%Y-%m-%d)"
|
||||
#define BUILD_TIME "$(date +%H:%M:%S)"
|
||||
#define BUILD_TIMESTAMP "$(date '+%Y-%m-%d %H:%M:%S')"
|
||||
|
||||
/* Git information */
|
||||
#define GIT_HASH "$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')"
|
||||
#define GIT_BRANCH "$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'unknown')"
|
||||
|
||||
/* Display versions */
|
||||
#define VERSION_DISPLAY "${NEW_VERSION}"
|
||||
#define VERSION_FULL_DISPLAY "${NEW_VERSION} ($(date '+%Y-%m-%d %H:%M:%S'), $(git rev-parse --short HEAD 2>/dev/null || echo 'unknown'))"
|
||||
|
||||
/* Version API functions */
|
||||
const char* get_version(void);
|
||||
const char* get_version_full(void);
|
||||
const char* get_build_info(void);
|
||||
|
||||
#endif /* VERSION_H */
|
||||
EOF
|
||||
|
||||
# Generate version.c implementation file
|
||||
cat > src/version.c << EOF
|
||||
/*
|
||||
* Auto-Generated Version Implementation
|
||||
* DO NOT EDIT THIS FILE MANUALLY - Generated by build script
|
||||
*/
|
||||
|
||||
#include "version.h"
|
||||
|
||||
const char* get_version(void) {
|
||||
return VERSION_TAG;
|
||||
}
|
||||
|
||||
const char* get_version_full(void) {
|
||||
return VERSION_FULL_DISPLAY;
|
||||
}
|
||||
|
||||
const char* get_build_info(void) {
|
||||
return "Built on " BUILD_DATE " at " BUILD_TIME " from commit " GIT_HASH " on branch " GIT_BRANCH;
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
### 3. Generate Version File for Other Languages
|
||||
|
||||
**Python (`src/__version__.py`):**
|
||||
```bash
|
||||
cat > src/__version__.py << EOF
|
||||
"""Auto-generated version file"""
|
||||
__version__ = "${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||
__version_tag__ = "${NEW_VERSION}"
|
||||
__build_date__ = "$(date +%Y-%m-%d)"
|
||||
__build_time__ = "$(date +%H:%M:%S)"
|
||||
__git_hash__ = "$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')"
|
||||
__git_branch__ = "$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'unknown')"
|
||||
EOF
|
||||
```
|
||||
|
||||
**JavaScript/Node.js (update `package.json`):**
|
||||
```bash
|
||||
# Update package.json version field
|
||||
if [ -f package.json ]; then
|
||||
sed -i "s/\"version\": \".*\"/\"version\": \"${MAJOR}.${MINOR}.${NEW_PATCH}\"/" package.json
|
||||
fi
|
||||
```
|
||||
|
||||
**Rust (update `Cargo.toml`):**
|
||||
```bash
|
||||
if [ -f Cargo.toml ]; then
|
||||
sed -i "s/^version = \".*\"/version = \"${MAJOR}.${MINOR}.${NEW_PATCH}\"/" Cargo.toml
|
||||
fi
|
||||
```
|
||||
|
||||
**Go (generate `version.go`):**
|
||||
```bash
|
||||
cat > version.go << EOF
|
||||
// Auto-generated version file
|
||||
package main
|
||||
|
||||
const (
|
||||
VersionMajor = ${MAJOR}
|
||||
VersionMinor = ${MINOR}
|
||||
VersionPatch = ${NEW_PATCH}
|
||||
VersionString = "${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||
VersionTag = "${NEW_VERSION}"
|
||||
BuildDate = "$(date +%Y-%m-%d)"
|
||||
BuildTime = "$(date +%H:%M:%S)"
|
||||
GitHash = "$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')"
|
||||
GitBranch = "$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'unknown')"
|
||||
)
|
||||
EOF
|
||||
```
|
||||
|
||||
**Java (generate `Version.java`):**
|
||||
```bash
|
||||
cat > src/main/java/Version.java << EOF
|
||||
// Auto-generated version class
|
||||
public class Version {
|
||||
public static final int VERSION_MAJOR = ${MAJOR};
|
||||
public static final int VERSION_MINOR = ${MINOR};
|
||||
public static final int VERSION_PATCH = ${NEW_PATCH};
|
||||
public static final String VERSION_STRING = "${MAJOR}.${MINOR}.${NEW_PATCH}";
|
||||
public static final String VERSION_TAG = "${NEW_VERSION}";
|
||||
public static final String BUILD_DATE = "$(date +%Y-%m-%d)";
|
||||
public static final String BUILD_TIME = "$(date +%H:%M:%S)";
|
||||
public static final String GIT_HASH = "$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')";
|
||||
public static final String GIT_BRANCH = "$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'unknown')";
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
### 4. Integrate into Build Targets
|
||||
Call `increment_version` before your main build commands:
|
||||
|
||||
```bash
|
||||
build_library() {
|
||||
increment_version
|
||||
echo "[INFO] Building library..."
|
||||
# Your actual build commands here
|
||||
make clean && make
|
||||
}
|
||||
|
||||
build_release() {
|
||||
increment_version
|
||||
echo "[INFO] Building release..."
|
||||
# Your release build commands
|
||||
}
|
||||
|
||||
build_package() {
|
||||
increment_version
|
||||
echo "[INFO] Building package..."
|
||||
# Your packaging commands
|
||||
}
|
||||
```
|
||||
|
||||
### 5. Update .gitignore
|
||||
Add generated version files to `.gitignore`:
|
||||
|
||||
```gitignore
|
||||
# Auto-generated version files
|
||||
src/version.h
|
||||
src/version.c
|
||||
src/__version__.py
|
||||
version.go
|
||||
src/main/java/Version.java
|
||||
VERSION
|
||||
```
|
||||
|
||||
### 6. Update Build System Files
|
||||
|
||||
**For Makefile projects:**
|
||||
```makefile
|
||||
# Add version.c to your source files
|
||||
SOURCES = main.c utils.c version.c
|
||||
```
|
||||
|
||||
**For CMake projects:**
|
||||
```cmake
|
||||
# Add version files to your target
|
||||
target_sources(your_target PRIVATE src/version.c)
|
||||
```
|
||||
|
||||
**For Node.js projects:**
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"build": "node build.js && increment_version",
|
||||
"version": "node -e \"console.log(require('./package.json').version)\""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 7. Create Initial Version Tag
|
||||
```bash
|
||||
# Start with initial version
|
||||
git tag v0.1.0
|
||||
```
|
||||
|
||||
## Usage Pattern
|
||||
```bash
|
||||
./build.sh # v0.1.0 → v0.1.1
|
||||
./build.sh release # v0.1.1 → v0.1.2
|
||||
./build.sh package # v0.1.2 → v0.1.3
|
||||
```
|
||||
|
||||
## Manual Version Control
|
||||
|
||||
### Major/Minor Version Bumps
|
||||
```bash
|
||||
# For feature releases (minor bump)
|
||||
git tag v0.2.0 # Next build: v0.2.1
|
||||
|
||||
# For breaking changes (major bump)
|
||||
git tag v1.0.0 # Next build: v1.0.1
|
||||
```
|
||||
|
||||
### Version Reset
|
||||
```bash
|
||||
# Delete incorrect tags (if needed)
|
||||
git tag -d v0.2.1
|
||||
git push origin --delete v0.2.1 # If pushed to remote
|
||||
|
||||
# Create correct base version
|
||||
git tag v0.2.0
|
||||
|
||||
# Next build will create v0.2.1
|
||||
```
|
||||
|
||||
## Example Build Script Template
|
||||
```bash
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
print_status() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
||||
print_success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; }
|
||||
print_warning() { echo -e "${YELLOW}[WARNING]${NC} $1"; }
|
||||
print_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
||||
|
||||
# Insert increment_version function here
|
||||
|
||||
case "${1:-build}" in
|
||||
build)
|
||||
increment_version
|
||||
print_status "Building project..."
|
||||
# Your build commands
|
||||
;;
|
||||
clean)
|
||||
print_status "Cleaning build artifacts..."
|
||||
# Your clean commands
|
||||
;;
|
||||
test)
|
||||
print_status "Running tests..."
|
||||
# Your test commands (no version increment)
|
||||
;;
|
||||
release)
|
||||
increment_version
|
||||
print_status "Building release..."
|
||||
# Your release commands
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {build|clean|test|release}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
```
|
||||
|
||||
## Benefits
|
||||
1. **Zero maintenance** - No manual version editing
|
||||
2. **Build traceability** - Every build has unique version + metadata
|
||||
3. **Git integration** - Automatic version tags
|
||||
4. **Language agnostic** - Adapt generation for any language
|
||||
5. **CI/CD friendly** - Works in automated environments
|
||||
6. **Rollback friendly** - Easy to revert to previous versions
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Version Not Incrementing
|
||||
- Ensure you're in a git repository
|
||||
- Check that git tags exist: `git tag --list`
|
||||
- Verify tag format matches `v*.*.*` pattern
|
||||
|
||||
### Tag Already Exists
|
||||
If a tag already exists, the build continues with existing version:
|
||||
```
|
||||
[WARNING] Tag v0.2.1 already exists - using existing version
|
||||
```
|
||||
|
||||
### Missing Git Information
|
||||
If git is unavailable, version files show "unknown" for git hash and branch.
|
||||
319
LIBRARY_USAGE.md
319
LIBRARY_USAGE.md
@@ -1,319 +0,0 @@
|
||||
# NOSTR Core Library - Usage Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The NOSTR Core Library (`libnostr_core`) is a self-contained, exportable C library for NOSTR protocol implementation. It requires **no external cryptographic dependencies** (no OpenSSL, no libwally) and can be easily integrated into other projects.
|
||||
|
||||
## Key Features
|
||||
|
||||
- **Self-Contained Crypto**: All cryptographic operations implemented from scratch
|
||||
- **Zero External Dependencies**: Only requires standard C library, cJSON, and libwebsockets
|
||||
- **Cross-Platform**: Builds on Linux, macOS, Windows (with appropriate toolchain)
|
||||
- **NIP-06 Compliant**: Proper BIP39/BIP32 implementation for key derivation
|
||||
- **Thread-Safe**: Core cryptographic functions are stateless and thread-safe
|
||||
- **Easy Integration**: Simple C API with clear error handling
|
||||
|
||||
## File Structure for Export
|
||||
|
||||
### Core Library Files (Required)
|
||||
```
|
||||
libnostr_core/
|
||||
├── nostr_core.h # Main public API header
|
||||
├── nostr_core.c # Core implementation
|
||||
├── nostr_crypto.h # Crypto implementation header
|
||||
├── nostr_crypto.c # Self-contained crypto implementation
|
||||
├── Makefile # Build configuration
|
||||
└── cjson/ # JSON library (can be replaced with system cJSON)
|
||||
├── cJSON.h
|
||||
└── cJSON.c
|
||||
```
|
||||
|
||||
### Optional Files
|
||||
```
|
||||
├── examples/ # Usage examples (helpful for integration)
|
||||
├── LIBRARY_USAGE.md # This usage guide
|
||||
├── SELF_CONTAINED_CRYPTO.md # Crypto implementation details
|
||||
└── CROSS_PLATFORM_GUIDE.md # Platform-specific build notes
|
||||
```
|
||||
|
||||
## Integration Methods
|
||||
|
||||
### Method 1: Static Library Integration
|
||||
|
||||
1. **Copy Required Files**:
|
||||
```bash
|
||||
cp nostr_core.h nostr_core.c nostr_crypto.h nostr_crypto.c /path/to/your/project/
|
||||
cp -r cjson/ /path/to/your/project/
|
||||
```
|
||||
|
||||
2. **Build Static Library**:
|
||||
```bash
|
||||
gcc -c -fPIC nostr_core.c nostr_crypto.c cjson/cJSON.c
|
||||
ar rcs libnostr_core.a nostr_core.o nostr_crypto.o cJSON.o
|
||||
```
|
||||
|
||||
3. **Link in Your Project**:
|
||||
```bash
|
||||
gcc your_project.c -L. -lnostr_core -lm -o your_project
|
||||
```
|
||||
|
||||
### Method 2: Direct Source Integration
|
||||
|
||||
Simply include the source files directly in your project:
|
||||
|
||||
```c
|
||||
// In your project
|
||||
#include "nostr_core.h"
|
||||
|
||||
// Compile with:
|
||||
// gcc your_project.c nostr_core.c nostr_crypto.c cjson/cJSON.c -lm
|
||||
```
|
||||
|
||||
### Method 3: Shared Library Integration
|
||||
|
||||
1. **Build Shared Library**:
|
||||
```bash
|
||||
make libnostr_core.so
|
||||
```
|
||||
|
||||
2. **Install System-Wide** (optional):
|
||||
```bash
|
||||
sudo cp libnostr_core.so /usr/local/lib/
|
||||
sudo cp nostr_core.h /usr/local/include/
|
||||
sudo ldconfig
|
||||
```
|
||||
|
||||
3. **Use in Projects**:
|
||||
```bash
|
||||
gcc your_project.c -lnostr_core -lm
|
||||
```
|
||||
|
||||
## Building the Library
|
||||
|
||||
### Using the Provided Build Script
|
||||
|
||||
The library includes an automated build script that handles all dependencies and creates a self-contained static library.
|
||||
|
||||
**IMPORTANT**: The build script must be run from within the `nostr_core_lib` directory:
|
||||
|
||||
```bash
|
||||
# Correct usage:
|
||||
cd nostr_core_lib
|
||||
./build.sh
|
||||
|
||||
# If you need to use it from your project directory:
|
||||
cd nostr_core_lib
|
||||
./build.sh
|
||||
cd ..
|
||||
gcc your_app.c nostr_core_lib/libnostr_core_x64.a -lz -ldl -lpthread -lm -o your_app
|
||||
```
|
||||
|
||||
**Common Error**: Running `./nostr_core_lib/build.sh` from outside the library directory will fail with:
|
||||
```
|
||||
[ERROR] Build script must be run from the nostr_core_lib directory
|
||||
```
|
||||
|
||||
### Build Script Options
|
||||
|
||||
```bash
|
||||
# Auto-detect NIPs from your source code
|
||||
./build.sh
|
||||
|
||||
# Force specific NIPs
|
||||
./build.sh --nips=1,6,19
|
||||
|
||||
# Build all available NIPs
|
||||
./build.sh --nips=all
|
||||
|
||||
# Build for specific architecture
|
||||
./build.sh arm64
|
||||
|
||||
# Build with tests
|
||||
./build.sh --tests
|
||||
|
||||
# Get help
|
||||
./build.sh --help
|
||||
```
|
||||
|
||||
The build script automatically:
|
||||
- Scans your `.c` files for `#include "nip*.h"` statements
|
||||
- Compiles only the needed NIPs
|
||||
- Creates a self-contained static library (`libnostr_core_x64.a`)
|
||||
- Includes all dependencies (OpenSSL, curl, secp256k1, cJSON)
|
||||
|
||||
## Basic Usage Example
|
||||
|
||||
```c
|
||||
#include "nostr_core.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
// Initialize the library
|
||||
if (nostr_init() != NOSTR_SUCCESS) {
|
||||
fprintf(stderr, "Failed to initialize NOSTR library\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Generate a keypair
|
||||
unsigned char private_key[32];
|
||||
unsigned char public_key[32];
|
||||
|
||||
if (nostr_generate_keypair(private_key, public_key) != NOSTR_SUCCESS) {
|
||||
fprintf(stderr, "Failed to generate keypair\n");
|
||||
nostr_cleanup();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Convert to hex and bech32
|
||||
char private_hex[65], public_hex[65];
|
||||
char nsec[100], npub[100];
|
||||
|
||||
nostr_bytes_to_hex(private_key, 32, private_hex);
|
||||
nostr_bytes_to_hex(public_key, 32, public_hex);
|
||||
nostr_key_to_bech32(private_key, "nsec", nsec);
|
||||
nostr_key_to_bech32(public_key, "npub", npub);
|
||||
|
||||
printf("Private Key: %s\n", private_hex);
|
||||
printf("Public Key: %s\n", public_hex);
|
||||
printf("nsec: %s\n", nsec);
|
||||
printf("npub: %s\n", npub);
|
||||
|
||||
// Create and sign an event
|
||||
cJSON* event = nostr_create_text_event("Hello NOSTR!", private_key);
|
||||
if (event) {
|
||||
char* event_json = cJSON_Print(event);
|
||||
printf("Signed Event: %s\n", event_json);
|
||||
free(event_json);
|
||||
cJSON_Delete(event);
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
nostr_cleanup();
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## Dependency Management
|
||||
|
||||
### Required Dependencies
|
||||
- **Standard C Library**: malloc, string functions, file I/O
|
||||
- **Math Library**: `-lm` (for cryptographic calculations)
|
||||
- **cJSON**: JSON parsing (included, or use system version)
|
||||
|
||||
### Optional Dependencies
|
||||
- **libwebsockets**: Only needed for relay communication functions
|
||||
- **System cJSON**: Can replace bundled version
|
||||
|
||||
### Minimal Integration (Crypto Only)
|
||||
If you only need key generation and signing:
|
||||
|
||||
```bash
|
||||
# Build with minimal dependencies
|
||||
gcc -DNOSTR_CRYPTO_ONLY your_project.c nostr_crypto.c -lm
|
||||
```
|
||||
|
||||
## Cross-Platform Considerations
|
||||
|
||||
### Linux
|
||||
- Works out of the box with GCC
|
||||
- Install build-essential: `sudo apt install build-essential`
|
||||
|
||||
### macOS
|
||||
- Works with Xcode command line tools
|
||||
- May need: `xcode-select --install`
|
||||
|
||||
### Windows
|
||||
- Use MinGW-w64 or MSYS2
|
||||
- Or integrate with Visual Studio project
|
||||
|
||||
### Embedded Systems
|
||||
- Library is designed to work on resource-constrained systems
|
||||
- No heap allocations in core crypto functions
|
||||
- Stack usage is predictable and bounded
|
||||
|
||||
## API Reference
|
||||
|
||||
### Initialization
|
||||
```c
|
||||
int nostr_init(void); // Initialize library
|
||||
void nostr_cleanup(void); // Cleanup resources
|
||||
const char* nostr_strerror(int error); // Get error string
|
||||
```
|
||||
|
||||
### Key Generation
|
||||
```c
|
||||
int nostr_generate_keypair(unsigned char* private_key, unsigned char* public_key);
|
||||
int nostr_generate_mnemonic_and_keys(char* mnemonic, size_t mnemonic_size,
|
||||
int account, unsigned char* private_key,
|
||||
unsigned char* public_key);
|
||||
int nostr_derive_keys_from_mnemonic(const char* mnemonic, int account,
|
||||
unsigned char* private_key, unsigned char* public_key);
|
||||
```
|
||||
|
||||
### Event Creation
|
||||
```c
|
||||
cJSON* nostr_create_text_event(const char* content, const unsigned char* private_key);
|
||||
cJSON* nostr_create_profile_event(const char* name, const char* about,
|
||||
const unsigned char* private_key);
|
||||
int nostr_sign_event(cJSON* event, const unsigned char* private_key);
|
||||
```
|
||||
|
||||
### Utilities
|
||||
```c
|
||||
void nostr_bytes_to_hex(const unsigned char* bytes, size_t len, char* hex);
|
||||
int nostr_hex_to_bytes(const char* hex, unsigned char* bytes, size_t len);
|
||||
int nostr_key_to_bech32(const unsigned char* key, const char* hrp, char* output);
|
||||
nostr_input_type_t nostr_detect_input_type(const char* input);
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
All functions return standardized error codes:
|
||||
|
||||
- `NOSTR_SUCCESS` (0): Operation successful
|
||||
- `NOSTR_ERROR_INVALID_INPUT` (-1): Invalid parameters
|
||||
- `NOSTR_ERROR_CRYPTO_FAILED` (-2): Cryptographic operation failed
|
||||
- `NOSTR_ERROR_MEMORY_FAILED` (-3): Memory allocation failed
|
||||
- `NOSTR_ERROR_IO_FAILED` (-4): File I/O operation failed
|
||||
- `NOSTR_ERROR_NETWORK_FAILED` (-5): Network operation failed
|
||||
|
||||
## Security Considerations
|
||||
|
||||
1. **Private Key Handling**: Always clear private keys from memory when done
|
||||
2. **Random Number Generation**: Uses `/dev/urandom` on Unix systems
|
||||
3. **Memory Safety**: All buffers are bounds-checked
|
||||
4. **Constant-Time Operations**: Critical crypto operations are timing-attack resistant
|
||||
|
||||
## Testing Your Integration
|
||||
|
||||
Use the provided examples to verify your integration:
|
||||
|
||||
```bash
|
||||
# Test key generation
|
||||
./examples/simple_keygen
|
||||
|
||||
# Test mnemonic functionality
|
||||
./examples/mnemonic_generation
|
||||
|
||||
# Test event creation
|
||||
./examples/text_event
|
||||
|
||||
# Test all functionality
|
||||
./examples/utility_functions
|
||||
```
|
||||
|
||||
## Support and Documentation
|
||||
|
||||
- See `examples/` directory for comprehensive usage examples
|
||||
- Check `SELF_CONTAINED_CRYPTO.md` for cryptographic implementation details
|
||||
- Review `CROSS_PLATFORM_GUIDE.md` for platform-specific notes
|
||||
- All functions are documented in `nostr_core.h`
|
||||
|
||||
## License
|
||||
|
||||
This library is designed to be freely integrable into other projects. Check the individual file headers for specific licensing information.
|
||||
|
||||
---
|
||||
|
||||
**Quick Start**: Copy `nostr_core.h`, `nostr_core.c`, `nostr_crypto.h`, `nostr_crypto.c`, and the `cjson/` folder to your project, then compile with `-lm`. That's it!
|
||||
755
POOL_API.md
Normal file
755
POOL_API.md
Normal file
@@ -0,0 +1,755 @@
|
||||
# Relay Pool API Reference
|
||||
|
||||
This document describes the public API for the Nostr Relay Pool implementation in [`core_relay_pool.c`](nostr_core/core_relay_pool.c).
|
||||
|
||||
## Function Summary
|
||||
|
||||
| Function | Description |
|
||||
|----------|-------------|
|
||||
| [`nostr_relay_pool_create()`](nostr_core/core_relay_pool.c:219) | Create and initialize a new relay pool |
|
||||
| [`nostr_relay_pool_destroy()`](nostr_core/core_relay_pool.c:304) | Destroy pool and cleanup all resources |
|
||||
| [`nostr_relay_pool_add_relay()`](nostr_core/core_relay_pool.c:229) | Add a relay URL to the pool |
|
||||
| [`nostr_relay_pool_remove_relay()`](nostr_core/core_relay_pool.c:273) | Remove a relay URL from the pool |
|
||||
| [`nostr_relay_pool_subscribe()`](nostr_core/core_relay_pool.c:399) | Create async subscription with callbacks |
|
||||
| [`nostr_pool_subscription_close()`](nostr_core/core_relay_pool.c:491) | Close subscription and free resources |
|
||||
| [`nostr_relay_pool_run()`](nostr_core/core_relay_pool.c:1192) | Run event loop for specified timeout |
|
||||
| [`nostr_relay_pool_poll()`](nostr_core/core_relay_pool.c:1232) | Single iteration poll and dispatch |
|
||||
| [`nostr_relay_pool_query_sync()`](nostr_core/core_relay_pool.c:695) | Synchronous query returning event array |
|
||||
| [`nostr_relay_pool_get_event()`](nostr_core/core_relay_pool.c:825) | Get single most recent event |
|
||||
| [`nostr_relay_pool_publish_async()`](nostr_core/core_relay_pool.c:866) | Publish event with async callbacks |
|
||||
| [`nostr_relay_pool_get_relay_status()`](nostr_core/core_relay_pool.c:944) | Get connection status for a relay |
|
||||
| [`nostr_relay_pool_list_relays()`](nostr_core/core_relay_pool.c:960) | List all relays and their statuses |
|
||||
| [`nostr_relay_pool_get_relay_stats()`](nostr_core/core_relay_pool.c:992) | Get detailed statistics for a relay |
|
||||
| [`nostr_relay_pool_reset_relay_stats()`](nostr_core/core_relay_pool.c:1008) | Reset statistics for a relay |
|
||||
| [`nostr_relay_pool_get_relay_query_latency()`](nostr_core/core_relay_pool.c:1045) | Get average query latency for a relay |
|
||||
|
||||
## Pool Lifecycle
|
||||
|
||||
### Create Pool
|
||||
**Function:** [`nostr_relay_pool_create()`](nostr_core/core_relay_pool.c:219)
|
||||
```c
|
||||
nostr_relay_pool_t* nostr_relay_pool_create(void);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
#include "nostr_core.h"
|
||||
|
||||
int main() {
|
||||
// Create a new relay pool
|
||||
nostr_relay_pool_t* pool = nostr_relay_pool_create();
|
||||
if (!pool) {
|
||||
fprintf(stderr, "Failed to create relay pool\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Use the pool...
|
||||
|
||||
// Clean up
|
||||
nostr_relay_pool_destroy(pool);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### Destroy Pool
|
||||
**Function:** [`nostr_relay_pool_destroy()`](nostr_core/core_relay_pool.c:304)
|
||||
```c
|
||||
void nostr_relay_pool_destroy(nostr_relay_pool_t* pool);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
// Properly cleanup a relay pool
|
||||
void cleanup_pool(nostr_relay_pool_t* pool) {
|
||||
if (pool) {
|
||||
// This will close all active subscriptions and relay connections
|
||||
nostr_relay_pool_destroy(pool);
|
||||
pool = NULL;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Relay Management
|
||||
|
||||
### Add Relay
|
||||
**Function:** [`nostr_relay_pool_add_relay()`](nostr_core/core_relay_pool.c:229)
|
||||
```c
|
||||
int nostr_relay_pool_add_relay(nostr_relay_pool_t* pool, const char* relay_url);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
int setup_relays(nostr_relay_pool_t* pool) {
|
||||
const char* relays[] = {
|
||||
"wss://relay.damus.io",
|
||||
"wss://nos.lol",
|
||||
"wss://relay.nostr.band"
|
||||
};
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
int result = nostr_relay_pool_add_relay(pool, relays[i]);
|
||||
if (result != NOSTR_SUCCESS) {
|
||||
fprintf(stderr, "Failed to add relay %s: %d\n", relays[i], result);
|
||||
return -1;
|
||||
}
|
||||
printf("Added relay: %s\n", relays[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### Remove Relay
|
||||
**Function:** [`nostr_relay_pool_remove_relay()`](nostr_core/core_relay_pool.c:273)
|
||||
```c
|
||||
int nostr_relay_pool_remove_relay(nostr_relay_pool_t* pool, const char* relay_url);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
int remove_slow_relay(nostr_relay_pool_t* pool) {
|
||||
const char* slow_relay = "wss://slow-relay.example.com";
|
||||
|
||||
int result = nostr_relay_pool_remove_relay(pool, slow_relay);
|
||||
if (result == NOSTR_SUCCESS) {
|
||||
printf("Successfully removed relay: %s\n", slow_relay);
|
||||
} else {
|
||||
printf("Failed to remove relay %s (may not exist)\n", slow_relay);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
```
|
||||
|
||||
## Subscriptions (Asynchronous)
|
||||
|
||||
### Subscribe to Events
|
||||
**Function:** [`nostr_relay_pool_subscribe()`](nostr_core/core_relay_pool.c:399)
|
||||
```c
|
||||
nostr_pool_subscription_t* nostr_relay_pool_subscribe(
|
||||
nostr_relay_pool_t* pool,
|
||||
const char** relay_urls,
|
||||
int relay_count,
|
||||
cJSON* filter,
|
||||
void (*on_event)(cJSON* event, const char* relay_url, void* user_data),
|
||||
void (*on_eose)(void* user_data),
|
||||
void* user_data);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
#include "cjson/cJSON.h"
|
||||
|
||||
// Event callback - called for each received event
|
||||
void handle_event(cJSON* event, const char* relay_url, void* user_data) {
|
||||
cJSON* content = cJSON_GetObjectItem(event, "content");
|
||||
cJSON* pubkey = cJSON_GetObjectItem(event, "pubkey");
|
||||
|
||||
if (content && pubkey) {
|
||||
printf("Event from %s: %s (by %s)\n",
|
||||
relay_url,
|
||||
cJSON_GetStringValue(content),
|
||||
cJSON_GetStringValue(pubkey));
|
||||
}
|
||||
}
|
||||
|
||||
// EOSE callback - called when all relays finish sending stored events
|
||||
void handle_eose(void* user_data) {
|
||||
printf("All relays finished sending stored events\n");
|
||||
}
|
||||
|
||||
int subscribe_to_notes(nostr_relay_pool_t* pool) {
|
||||
// Create filter for kind 1 (text notes) from last hour
|
||||
cJSON* filter = cJSON_CreateObject();
|
||||
cJSON* kinds = cJSON_CreateArray();
|
||||
cJSON_AddItemToArray(kinds, cJSON_CreateNumber(1));
|
||||
cJSON_AddItemToObject(filter, "kinds", kinds);
|
||||
|
||||
time_t since = time(NULL) - 3600; // Last hour
|
||||
cJSON_AddItemToObject(filter, "since", cJSON_CreateNumber(since));
|
||||
cJSON_AddItemToObject(filter, "limit", cJSON_CreateNumber(50));
|
||||
|
||||
// Subscribe to specific relays
|
||||
const char* relay_urls[] = {
|
||||
"wss://relay.damus.io",
|
||||
"wss://nos.lol"
|
||||
};
|
||||
|
||||
nostr_pool_subscription_t* sub = nostr_relay_pool_subscribe(
|
||||
pool,
|
||||
relay_urls,
|
||||
2,
|
||||
filter,
|
||||
handle_event,
|
||||
handle_eose,
|
||||
NULL // user_data
|
||||
);
|
||||
|
||||
cJSON_Delete(filter); // Pool makes its own copy
|
||||
|
||||
if (!sub) {
|
||||
fprintf(stderr, "Failed to create subscription\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Drive the event loop to receive events
|
||||
printf("Listening for events for 30 seconds...\n");
|
||||
nostr_relay_pool_run(pool, 30000); // 30 seconds
|
||||
|
||||
// Close subscription
|
||||
nostr_pool_subscription_close(sub);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### Close Subscription
|
||||
**Function:** [`nostr_pool_subscription_close()`](nostr_core/core_relay_pool.c:491)
|
||||
```c
|
||||
int nostr_pool_subscription_close(nostr_pool_subscription_t* subscription);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
// Subscription management with cleanup
|
||||
typedef struct {
|
||||
nostr_pool_subscription_t* subscription;
|
||||
int event_count;
|
||||
int should_stop;
|
||||
} subscription_context_t;
|
||||
|
||||
void event_counter(cJSON* event, const char* relay_url, void* user_data) {
|
||||
subscription_context_t* ctx = (subscription_context_t*)user_data;
|
||||
ctx->event_count++;
|
||||
|
||||
printf("Received event #%d from %s\n", ctx->event_count, relay_url);
|
||||
|
||||
// Stop after 10 events
|
||||
if (ctx->event_count >= 10) {
|
||||
ctx->should_stop = 1;
|
||||
}
|
||||
}
|
||||
|
||||
int limited_subscription(nostr_relay_pool_t* pool) {
|
||||
subscription_context_t ctx = {0};
|
||||
|
||||
// Create filter
|
||||
cJSON* filter = cJSON_CreateObject();
|
||||
cJSON* kinds = cJSON_CreateArray();
|
||||
cJSON_AddItemToArray(kinds, cJSON_CreateNumber(1));
|
||||
cJSON_AddItemToObject(filter, "kinds", kinds);
|
||||
|
||||
const char* relay_urls[] = {"wss://relay.damus.io"};
|
||||
|
||||
ctx.subscription = nostr_relay_pool_subscribe(
|
||||
pool, relay_urls, 1, filter, event_counter, NULL, &ctx);
|
||||
|
||||
cJSON_Delete(filter);
|
||||
|
||||
if (!ctx.subscription) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Poll until we should stop
|
||||
while (!ctx.should_stop) {
|
||||
int events = nostr_relay_pool_poll(pool, 100);
|
||||
if (events < 0) break;
|
||||
}
|
||||
|
||||
// Clean up
|
||||
int result = nostr_pool_subscription_close(ctx.subscription);
|
||||
printf("Subscription closed with result: %d\n", result);
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## Event Loop
|
||||
|
||||
### Run Timed Loop
|
||||
**Function:** [`nostr_relay_pool_run()`](nostr_core/core_relay_pool.c:1192)
|
||||
```c
|
||||
int nostr_relay_pool_run(nostr_relay_pool_t* pool, int timeout_ms);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
int run_event_loop(nostr_relay_pool_t* pool) {
|
||||
printf("Starting event loop for 60 seconds...\n");
|
||||
|
||||
// Run for 60 seconds, processing all incoming events
|
||||
int total_events = nostr_relay_pool_run(pool, 60000);
|
||||
|
||||
if (total_events < 0) {
|
||||
fprintf(stderr, "Event loop error\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Processed %d events total\n", total_events);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### Single Poll Iteration
|
||||
**Function:** [`nostr_relay_pool_poll()`](nostr_core/core_relay_pool.c:1232)
|
||||
```c
|
||||
int nostr_relay_pool_poll(nostr_relay_pool_t* pool, int timeout_ms);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
// Integration with custom main loop
|
||||
int custom_main_loop(nostr_relay_pool_t* pool) {
|
||||
int running = 1;
|
||||
int total_events = 0;
|
||||
|
||||
while (running) {
|
||||
// Poll for Nostr events (non-blocking with 50ms timeout)
|
||||
int events = nostr_relay_pool_poll(pool, 50);
|
||||
if (events > 0) {
|
||||
total_events += events;
|
||||
printf("Processed %d events this iteration\n", events);
|
||||
}
|
||||
|
||||
// Do other work in your application
|
||||
// handle_ui_events();
|
||||
// process_background_tasks();
|
||||
|
||||
// Check exit condition
|
||||
// running = !should_exit();
|
||||
|
||||
// Simple exit after 100 events for demo
|
||||
if (total_events >= 100) {
|
||||
running = 0;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Main loop finished, processed %d total events\n", total_events);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## Synchronous Operations
|
||||
|
||||
### Query Multiple Events
|
||||
**Function:** [`nostr_relay_pool_query_sync()`](nostr_core/core_relay_pool.c:695)
|
||||
```c
|
||||
cJSON** nostr_relay_pool_query_sync(
|
||||
nostr_relay_pool_t* pool,
|
||||
const char** relay_urls,
|
||||
int relay_count,
|
||||
cJSON* filter,
|
||||
int* event_count,
|
||||
int timeout_ms);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
int query_recent_notes(nostr_relay_pool_t* pool) {
|
||||
// Create filter for recent text notes
|
||||
cJSON* filter = cJSON_CreateObject();
|
||||
cJSON* kinds = cJSON_CreateArray();
|
||||
cJSON_AddItemToArray(kinds, cJSON_CreateNumber(1));
|
||||
cJSON_AddItemToObject(filter, "kinds", kinds);
|
||||
cJSON_AddItemToObject(filter, "limit", cJSON_CreateNumber(20));
|
||||
|
||||
const char* relay_urls[] = {
|
||||
"wss://relay.damus.io",
|
||||
"wss://nos.lol"
|
||||
};
|
||||
|
||||
int event_count = 0;
|
||||
cJSON** events = nostr_relay_pool_query_sync(
|
||||
pool, relay_urls, 2, filter, &event_count, 10000); // 10 second timeout
|
||||
|
||||
cJSON_Delete(filter);
|
||||
|
||||
if (!events) {
|
||||
printf("No events received or query failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Received %d events:\n", event_count);
|
||||
for (int i = 0; i < event_count; i++) {
|
||||
cJSON* content = cJSON_GetObjectItem(events[i], "content");
|
||||
if (content) {
|
||||
printf(" %d: %s\n", i + 1, cJSON_GetStringValue(content));
|
||||
}
|
||||
|
||||
// Free each event
|
||||
cJSON_Delete(events[i]);
|
||||
}
|
||||
|
||||
// Free the events array
|
||||
free(events);
|
||||
return event_count;
|
||||
}
|
||||
```
|
||||
|
||||
### Get Single Most Recent Event
|
||||
**Function:** [`nostr_relay_pool_get_event()`](nostr_core/core_relay_pool.c:825)
|
||||
```c
|
||||
cJSON* nostr_relay_pool_get_event(
|
||||
nostr_relay_pool_t* pool,
|
||||
const char** relay_urls,
|
||||
int relay_count,
|
||||
cJSON* filter,
|
||||
int timeout_ms);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
int get_latest_note_from_pubkey(nostr_relay_pool_t* pool, const char* pubkey_hex) {
|
||||
// Create filter for specific author's notes
|
||||
cJSON* filter = cJSON_CreateObject();
|
||||
cJSON* kinds = cJSON_CreateArray();
|
||||
cJSON_AddItemToArray(kinds, cJSON_CreateNumber(1));
|
||||
cJSON_AddItemToObject(filter, "kinds", kinds);
|
||||
|
||||
cJSON* authors = cJSON_CreateArray();
|
||||
cJSON_AddItemToArray(authors, cJSON_CreateString(pubkey_hex));
|
||||
cJSON_AddItemToObject(filter, "authors", authors);
|
||||
|
||||
cJSON_AddItemToObject(filter, "limit", cJSON_CreateNumber(1));
|
||||
|
||||
const char* relay_urls[] = {"wss://relay.damus.io"};
|
||||
|
||||
cJSON* event = nostr_relay_pool_get_event(
|
||||
pool, relay_urls, 1, filter, 5000); // 5 second timeout
|
||||
|
||||
cJSON_Delete(filter);
|
||||
|
||||
if (!event) {
|
||||
printf("No recent event found for pubkey %s\n", pubkey_hex);
|
||||
return -1;
|
||||
}
|
||||
|
||||
cJSON* content = cJSON_GetObjectItem(event, "content");
|
||||
cJSON* created_at = cJSON_GetObjectItem(event, "created_at");
|
||||
|
||||
if (content && created_at) {
|
||||
printf("Latest note: %s (created at %ld)\n",
|
||||
cJSON_GetStringValue(content),
|
||||
(long)cJSON_GetNumberValue(created_at));
|
||||
}
|
||||
|
||||
cJSON_Delete(event);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### Publish Event
|
||||
**Function:** [`nostr_relay_pool_publish_async()`](nostr_core/core_relay_pool.c:866)
|
||||
```c
|
||||
int nostr_relay_pool_publish_async(
|
||||
nostr_relay_pool_t* pool,
|
||||
const char** relay_urls,
|
||||
int relay_count,
|
||||
cJSON* event);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
int publish_text_note(nostr_relay_pool_t* pool, const char* content) {
|
||||
// Create a basic text note event (this is simplified - real implementation
|
||||
// would need proper signing with private key)
|
||||
cJSON* event = cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(event, "kind", cJSON_CreateNumber(1));
|
||||
cJSON_AddItemToObject(event, "content", cJSON_CreateString(content));
|
||||
cJSON_AddItemToObject(event, "created_at", cJSON_CreateNumber(time(NULL)));
|
||||
|
||||
// In real usage, you'd add pubkey, id, sig fields here
|
||||
cJSON_AddItemToObject(event, "pubkey", cJSON_CreateString("your_pubkey_hex"));
|
||||
cJSON_AddItemToObject(event, "id", cJSON_CreateString("event_id_hash"));
|
||||
cJSON_AddItemToObject(event, "sig", cJSON_CreateString("event_signature"));
|
||||
cJSON_AddItemToObject(event, "tags", cJSON_CreateArray());
|
||||
|
||||
const char* relay_urls[] = {
|
||||
"wss://relay.damus.io",
|
||||
"wss://nos.lol",
|
||||
"wss://relay.nostr.band"
|
||||
};
|
||||
|
||||
printf("Publishing note: %s\n", content);
|
||||
|
||||
int success_count = nostr_relay_pool_publish_async(
|
||||
pool, relay_urls, 3, event, my_callback, user_data);
|
||||
|
||||
cJSON_Delete(event);
|
||||
|
||||
printf("Successfully published to %d out of 3 relays\n", success_count);
|
||||
|
||||
if (success_count == 0) {
|
||||
fprintf(stderr, "Failed to publish to any relay\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return success_count;
|
||||
}
|
||||
```
|
||||
|
||||
## Status and Statistics
|
||||
|
||||
### Get Relay Status
|
||||
**Function:** [`nostr_relay_pool_get_relay_status()`](nostr_core/core_relay_pool.c:944)
|
||||
```c
|
||||
nostr_pool_relay_status_t nostr_relay_pool_get_relay_status(
|
||||
nostr_relay_pool_t* pool,
|
||||
const char* relay_url);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
void check_relay_status(nostr_relay_pool_t* pool, const char* relay_url) {
|
||||
nostr_pool_relay_status_t status = nostr_relay_pool_get_relay_status(pool, relay_url);
|
||||
|
||||
const char* status_str;
|
||||
switch (status) {
|
||||
case NOSTR_POOL_RELAY_DISCONNECTED:
|
||||
status_str = "DISCONNECTED";
|
||||
break;
|
||||
case NOSTR_POOL_RELAY_CONNECTING:
|
||||
status_str = "CONNECTING";
|
||||
break;
|
||||
case NOSTR_POOL_RELAY_CONNECTED:
|
||||
status_str = "CONNECTED";
|
||||
break;
|
||||
case NOSTR_POOL_RELAY_ERROR:
|
||||
status_str = "ERROR";
|
||||
break;
|
||||
default:
|
||||
status_str = "UNKNOWN";
|
||||
break;
|
||||
}
|
||||
|
||||
printf("Relay %s status: %s\n", relay_url, status_str);
|
||||
}
|
||||
```
|
||||
|
||||
### List All Relays
|
||||
**Function:** [`nostr_relay_pool_list_relays()`](nostr_core/core_relay_pool.c:960)
|
||||
```c
|
||||
int nostr_relay_pool_list_relays(
|
||||
nostr_relay_pool_t* pool,
|
||||
char*** relay_urls,
|
||||
nostr_pool_relay_status_t** statuses);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
void print_all_relays(nostr_relay_pool_t* pool) {
|
||||
char** relay_urls = NULL;
|
||||
nostr_pool_relay_status_t* statuses = NULL;
|
||||
|
||||
int count = nostr_relay_pool_list_relays(pool, &relay_urls, &statuses);
|
||||
|
||||
if (count < 0) {
|
||||
printf("Failed to list relays\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
printf("No relays configured\n");
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Configured relays (%d):\n", count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
const char* status_str = (statuses[i] == NOSTR_POOL_RELAY_CONNECTED) ?
|
||||
"CONNECTED" : "DISCONNECTED";
|
||||
printf(" %s - %s\n", relay_urls[i], status_str);
|
||||
|
||||
// Free the duplicated URL string
|
||||
free(relay_urls[i]);
|
||||
}
|
||||
|
||||
// Free the arrays
|
||||
free(relay_urls);
|
||||
free(statuses);
|
||||
}
|
||||
```
|
||||
|
||||
### Get Relay Statistics
|
||||
**Function:** [`nostr_relay_pool_get_relay_stats()`](nostr_core/core_relay_pool.c:992)
|
||||
```c
|
||||
const nostr_relay_stats_t* nostr_relay_pool_get_relay_stats(
|
||||
nostr_relay_pool_t* pool,
|
||||
const char* relay_url);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
void print_relay_stats(nostr_relay_pool_t* pool, const char* relay_url) {
|
||||
const nostr_relay_stats_t* stats = nostr_relay_pool_get_relay_stats(pool, relay_url);
|
||||
|
||||
if (!stats) {
|
||||
printf("No stats available for relay %s\n", relay_url);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Statistics for %s:\n", relay_url);
|
||||
printf(" Connection attempts: %d\n", stats->connection_attempts);
|
||||
printf(" Connection failures: %d\n", stats->connection_failures);
|
||||
printf(" Events received: %d\n", stats->events_received);
|
||||
printf(" Events published: %d\n", stats->events_published);
|
||||
printf(" Events published OK: %d\n", stats->events_published_ok);
|
||||
printf(" Events published failed: %d\n", stats->events_published_failed);
|
||||
printf(" Query latency avg: %.2f ms\n", stats->query_latency_avg);
|
||||
printf(" Query samples: %d\n", stats->query_samples);
|
||||
printf(" Publish latency avg: %.2f ms\n", stats->publish_latency_avg);
|
||||
printf(" Publish samples: %d\n", stats->publish_samples);
|
||||
|
||||
if (stats->last_event_time > 0) {
|
||||
printf(" Last event: %ld seconds ago\n",
|
||||
time(NULL) - stats->last_event_time);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Reset Relay Statistics
|
||||
**Function:** [`nostr_relay_pool_reset_relay_stats()`](nostr_core/core_relay_pool.c:1008)
|
||||
```c
|
||||
int nostr_relay_pool_reset_relay_stats(
|
||||
nostr_relay_pool_t* pool,
|
||||
const char* relay_url);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
void reset_stats_for_relay(nostr_relay_pool_t* pool, const char* relay_url) {
|
||||
int result = nostr_relay_pool_reset_relay_stats(pool, relay_url);
|
||||
|
||||
if (result == NOSTR_SUCCESS) {
|
||||
printf("Successfully reset statistics for %s\n", relay_url);
|
||||
} else {
|
||||
printf("Failed to reset statistics for %s\n", relay_url);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Get Query Latency
|
||||
**Function:** [`nostr_relay_pool_get_relay_query_latency()`](nostr_core/core_relay_pool.c:1045)
|
||||
```c
|
||||
double nostr_relay_pool_get_relay_query_latency(
|
||||
nostr_relay_pool_t* pool,
|
||||
const char* relay_url);
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```c
|
||||
void check_relay_performance(nostr_relay_pool_t* pool) {
|
||||
const char* relays[] = {
|
||||
"wss://relay.damus.io",
|
||||
"wss://nos.lol",
|
||||
"wss://relay.nostr.band"
|
||||
};
|
||||
|
||||
printf("Relay performance comparison:\n");
|
||||
for (int i = 0; i < 3; i++) {
|
||||
double latency = nostr_relay_pool_get_relay_query_latency(pool, relays[i]);
|
||||
|
||||
if (latency >= 0) {
|
||||
printf(" %s: %.2f ms average query latency\n", relays[i], latency);
|
||||
} else {
|
||||
printf(" %s: No latency data available\n", relays[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Complete Example Application
|
||||
|
||||
```c
|
||||
#include "nostr_core.h"
|
||||
#include "cjson/cJSON.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
// Global context for the example
|
||||
typedef struct {
|
||||
int event_count;
|
||||
int max_events;
|
||||
} app_context_t;
|
||||
|
||||
void on_text_note(cJSON* event, const char* relay_url, void* user_data) {
|
||||
app_context_t* ctx = (app_context_t*)user_data;
|
||||
|
||||
cJSON* content = cJSON_GetObjectItem(event, "content");
|
||||
if (content && cJSON_IsString(content)) {
|
||||
printf("[%s] Note #%d: %s\n",
|
||||
relay_url, ++ctx->event_count, cJSON_GetStringValue(content));
|
||||
}
|
||||
}
|
||||
|
||||
void on_subscription_complete(void* user_data) {
|
||||
printf("All relays finished sending stored events\n");
|
||||
}
|
||||
|
||||
int main() {
|
||||
// Initialize pool
|
||||
nostr_relay_pool_t* pool = nostr_relay_pool_create();
|
||||
if (!pool) {
|
||||
fprintf(stderr, "Failed to create relay pool\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Add relays
|
||||
const char* relays[] = {
|
||||
"wss://relay.damus.io",
|
||||
"wss://nos.lol"
|
||||
};
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (nostr_relay_pool_add_relay(pool, relays[i]) != NOSTR_SUCCESS) {
|
||||
fprintf(stderr, "Failed to add relay: %s\n", relays[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Create filter for recent text notes
|
||||
cJSON* filter = cJSON_CreateObject();
|
||||
cJSON* kinds = cJSON_CreateArray();
|
||||
cJSON_AddItemToArray(kinds, cJSON_CreateNumber(1));
|
||||
cJSON_AddItemToObject(filter, "kinds", kinds);
|
||||
cJSON_AddItemToObject(filter, "limit", cJSON_CreateNumber(10));
|
||||
|
||||
// Set up context
|
||||
app_context_t ctx = {0, 10};
|
||||
|
||||
// Subscribe
|
||||
nostr_pool_subscription_t* sub = nostr_relay_pool_subscribe(
|
||||
pool, relays, 2, filter, on_text_note, on_subscription_complete, &ctx);
|
||||
|
||||
cJSON_Delete(filter);
|
||||
|
||||
if (!sub) {
|
||||
fprintf(stderr, "Failed to create subscription\n");
|
||||
nostr_relay_pool_destroy(pool);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Run event loop for 30 seconds
|
||||
printf("Listening for events...\n");
|
||||
nostr_relay_pool_run(pool, 30000);
|
||||
|
||||
// Print final stats
|
||||
for (int i = 0; i < 2; i++) {
|
||||
print_relay_stats(pool, relays[i]);
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
nostr_pool_subscription_close(sub);
|
||||
nostr_relay_pool_destroy(pool);
|
||||
|
||||
printf("Application finished. Received %d events total.\n", ctx.event_count);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- All functions are **not thread-safe**. Use from a single thread or add external synchronization.
|
||||
- **Memory ownership**: The pool duplicates filters and URLs internally. Caller owns returned events and must free them.
|
||||
- **Event deduplication** is applied pool-wide using a circular buffer of 1000 event IDs.
|
||||
- **Ping functionality** is currently disabled in this build.
|
||||
- **Reconnection** happens on-demand when sending, but active subscriptions are not automatically re-sent after reconnect.
|
||||
- **Polling model**: You must drive the event loop via [`nostr_relay_pool_run()`](nostr_core/core_relay_pool.c:1192) or [`nostr_relay_pool_poll()`](nostr_core/core_relay_pool.c:1232) to receive events.
|
||||
248
README.md
248
README.md
@@ -1,46 +1,103 @@
|
||||
# NOSTR Core Library
|
||||
|
||||
A comprehensive, production-ready C library for NOSTR protocol implementation with OpenSSL-based cryptography and extensive protocol support.
|
||||
A C library for NOSTR protocol implementation. Work in progress.
|
||||
|
||||
[](VERSION)
|
||||
[](VERSION)
|
||||
[](#license)
|
||||
[](#building)
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
### Core Protocol Support
|
||||
- **NIP-01**: Basic protocol flow - event creation, signing, and validation
|
||||
- **NIP-04**: Encrypted direct messages (ECDH + AES-CBC + Base64)
|
||||
- **NIP-05**: DNS-based internet identifier verification
|
||||
- **NIP-06**: Key derivation from mnemonic (BIP39/BIP32 compliant)
|
||||
- **NIP-11**: Relay information documents
|
||||
- **NIP-13**: Proof of Work for events
|
||||
- **NIP-44**: Versioned encrypted direct messages (ECDH + ChaCha20 + HMAC)
|
||||
## 📋 NIP Implementation Status
|
||||
|
||||
### Cryptographic Features
|
||||
- **OpenSSL-Based**: Production-grade cryptography with OpenSSL backend
|
||||
- **Secp256k1**: Complete elliptic curve implementation bundled
|
||||
- **BIP39**: Mnemonic phrase generation and validation
|
||||
- **BIP32**: Hierarchical deterministic key derivation
|
||||
- **ChaCha20**: Stream cipher for NIP-44 encryption
|
||||
- **AES-CBC**: Block cipher for NIP-04 encryption
|
||||
- **Schnorr Signatures**: BIP-340 compliant signing and verification
|
||||
### Core Protocol NIPs
|
||||
- [x] [NIP-01](nips/01.md) - Basic protocol flow - event creation, signing, and validation
|
||||
- [ ] [NIP-02](nips/02.md) - Contact List and Petnames
|
||||
- [ ] [NIP-03](nips/03.md) - OpenTimestamps Attestations for Events
|
||||
- [x] [NIP-04](nips/04.md) - Encrypted Direct Messages (legacy)
|
||||
- [x] [NIP-05](nips/05.md) - Mapping Nostr keys to DNS-based internet identifiers
|
||||
- [x] [NIP-06](nips/06.md) - Basic key derivation from mnemonic seed phrase
|
||||
- [ ] [NIP-07](nips/07.md) - `window.nostr` capability for web browsers
|
||||
- [ ] [NIP-08](nips/08.md) - Handling Mentions
|
||||
- [ ] [NIP-09](nips/09.md) - Event Deletion
|
||||
- [ ] [NIP-10](nips/10.md) - Conventions for clients' use of `e` and `p` tags in text events
|
||||
- [x] [NIP-11](nips/11.md) - Relay Information Document
|
||||
- [ ] [NIP-12](nips/12.md) - Generic Tag Queries
|
||||
- [x] [NIP-13](nips/13.md) - Proof of Work
|
||||
- [ ] [NIP-14](nips/14.md) - Subject tag in text events
|
||||
- [ ] [NIP-15](nips/15.md) - Nostr Marketplace (for resilient marketplaces)
|
||||
- [ ] [NIP-16](nips/16.md) - Event Treatment
|
||||
- [x] [NIP-17](nips/17.md) - Private Direct Messages
|
||||
- [ ] [NIP-18](nips/18.md) - Reposts
|
||||
- [x] [NIP-19](nips/19.md) - bech32-encoded entities
|
||||
- [ ] [NIP-20](nips/20.md) - Command Results
|
||||
- [x] [NIP-21](nips/21.md) - `nostr:` URI scheme
|
||||
- [ ] [NIP-22](nips/22.md) - Event `created_at` Limits
|
||||
- [ ] [NIP-23](nips/23.md) - Long-form Content
|
||||
- [ ] [NIP-24](nips/24.md) - Extra metadata fields and tags
|
||||
- [ ] [NIP-25](nips/25.md) - Reactions
|
||||
- [ ] [NIP-26](nips/26.md) - Delegated Event Signing
|
||||
- [ ] [NIP-27](nips/27.md) - Text Note References
|
||||
- [ ] [NIP-28](nips/28.md) - Public Chat
|
||||
- [ ] [NIP-29](nips/29.md) - Relay-based Groups
|
||||
- [ ] [NIP-30](nips/30.md) - Custom Emoji
|
||||
- [ ] [NIP-31](nips/31.md) - Dealing with Unknown Events
|
||||
- [ ] [NIP-32](nips/32.md) - Labeling
|
||||
- [ ] [NIP-33](nips/33.md) - Parameterized Replaceable Events
|
||||
- [ ] [NIP-34](nips/34.md) - `git` stuff
|
||||
- [ ] [NIP-35](nips/35.md) - Torrents
|
||||
- [ ] [NIP-36](nips/36.md) - Sensitive Content / Content Warning
|
||||
- [ ] [NIP-37](nips/37.md) - Draft Events
|
||||
- [ ] [NIP-38](nips/38.md) - User Statuses
|
||||
- [ ] [NIP-39](nips/39.md) - External Identities in Profiles
|
||||
- [ ] [NIP-40](nips/40.md) - Expiration Timestamp
|
||||
- [x] [NIP-42](nips/42.md) - Authentication of clients to relays
|
||||
- [x] [NIP-44](nips/44.md) - Versioned Encryption
|
||||
- [ ] [NIP-45](nips/45.md) - Counting results
|
||||
- [ ] [NIP-46](nips/46.md) - Nostr Connect
|
||||
- [ ] [NIP-47](nips/47.md) - Wallet Connect
|
||||
- [ ] [NIP-48](nips/48.md) - Proxy Tags
|
||||
- [ ] [NIP-49](nips/49.md) - Private Key Encryption
|
||||
- [ ] [NIP-50](nips/50.md) - Search Capability
|
||||
- [ ] [NIP-51](nips/51.md) - Lists
|
||||
- [ ] [NIP-52](nips/52.md) - Calendar Events
|
||||
- [ ] [NIP-53](nips/53.md) - Live Activities
|
||||
- [ ] [NIP-54](nips/54.md) - Wiki
|
||||
- [ ] [NIP-55](nips/55.md) - Android Signer Application
|
||||
- [ ] [NIP-56](nips/56.md) - Reporting
|
||||
- [ ] [NIP-57](nips/57.md) - Lightning Zaps
|
||||
- [ ] [NIP-58](nips/58.md) - Badges
|
||||
- [x] [NIP-59](nips/59.md) - Gift Wrap
|
||||
- [ ] [NIP-60](nips/60.md) - Cashu Wallet
|
||||
- [ ] [NIP-61](nips/61.md) - Nutzaps
|
||||
- [ ] [NIP-62](nips/62.md) - Log events
|
||||
- [ ] [NIP-64](nips/64.md) - Chess (PGN)
|
||||
- [ ] [NIP-65](nips/65.md) - Relay List Metadata
|
||||
- [ ] [NIP-66](nips/66.md) - Relay Monitor
|
||||
- [ ] [NIP-68](nips/68.md) - Web badges
|
||||
- [ ] [NIP-69](nips/69.md) - Peer-to-peer Order events
|
||||
- [ ] [NIP-70](nips/70.md) - Protected Events
|
||||
- [ ] [NIP-71](nips/71.md) - Video Events
|
||||
- [ ] [NIP-72](nips/72.md) - Moderated Communities
|
||||
- [ ] [NIP-73](nips/73.md) - External Content IDs
|
||||
- [ ] [NIP-75](nips/75.md) - Zap Goals
|
||||
- [ ] [NIP-77](nips/77.md) - Arbitrary custom app data
|
||||
- [ ] [NIP-78](nips/78.md) - Application-specific data
|
||||
- [ ] [NIP-84](nips/84.md) - Highlights
|
||||
- [ ] [NIP-86](nips/86.md) - Relay Management API
|
||||
- [ ] [NIP-87](nips/87.md) - Relay List Recommendations
|
||||
- [ ] [NIP-88](nips/88.md) - Stella: A Stellar Relay
|
||||
- [ ] [NIP-89](nips/89.md) - Recommended Application Handlers
|
||||
- [ ] [NIP-90](nips/90.md) - Data Vending Machines
|
||||
- [ ] [NIP-92](nips/92.md) - Media Attachments
|
||||
- [ ] [NIP-94](nips/94.md) - File Metadata
|
||||
- [ ] [NIP-96](nips/96.md) - HTTP File Storage Integration
|
||||
- [ ] [NIP-98](nips/98.md) - HTTP Auth
|
||||
- [ ] [NIP-99](nips/99.md) - Classified Listings
|
||||
|
||||
### Networking & Relay Support
|
||||
- **Multi-Relay Queries**: Synchronous querying with progress callbacks
|
||||
- **Relay Pools**: Asynchronous connection management with statistics
|
||||
- **OpenSSL WebSocket Communication**: Full relay protocol support with TLS
|
||||
- **NIP-05 Identifier Verification**: DNS-based identity resolution
|
||||
- **NIP-11 Relay Information**: Automatic relay capability discovery
|
||||
- **Event Deduplication**: Automatic handling of duplicate events across relays
|
||||
- **Connection Management**: Automatic reconnection and error handling
|
||||
**Legend:** ✅ Fully Implemented | ⚠️ Partial Implementation | ❌ Not Implemented
|
||||
|
||||
**Implementation Summary:** 12 of 96+ NIPs fully implemented (12.5%)
|
||||
|
||||
### Developer Experience
|
||||
- **Minimal Dependencies**: Only requires OpenSSL, standard C library and math library
|
||||
- **Thread-Safe**: Core cryptographic functions are stateless
|
||||
- **Cross-Platform**: Builds on Linux, macOS, Windows
|
||||
- **Comprehensive Examples**: Ready-to-run demonstration programs
|
||||
- **Automatic Versioning**: Git-tag based version management
|
||||
|
||||
## 📦 Quick Start
|
||||
|
||||
@@ -138,19 +195,32 @@ make clean
|
||||
|
||||
### Dependencies
|
||||
|
||||
**Required:**
|
||||
**Required System Dependencies:**
|
||||
- GCC or compatible C compiler
|
||||
- Standard C library
|
||||
- Math library (`-lm`)
|
||||
- Standard C library and math library (`-lm`)
|
||||
- OpenSSL development libraries (`-lssl -lcrypto`)
|
||||
- curl development libraries (`-lcurl`)
|
||||
- secp256k1 development libraries (`-lsecp256k1`)
|
||||
|
||||
**Included & Embedded (x64):**
|
||||
- cJSON (JSON parsing)
|
||||
- secp256k1 (elliptic curve cryptography)
|
||||
- OpenSSL (complete cryptographic backend + TLS)
|
||||
- curl (HTTP/HTTPS for NIP-05/NIP-11)
|
||||
**Install on Ubuntu/Debian:**
|
||||
```bash
|
||||
sudo apt install build-essential libssl-dev libcurl4-openssl-dev libsecp256k1-dev
|
||||
```
|
||||
|
||||
**ARM64 Additional Requirements:**
|
||||
- System OpenSSL libraries (`-lssl -lcrypto`)
|
||||
**Install on CentOS/RHEL:**
|
||||
```bash
|
||||
sudo yum install gcc openssl-devel libcurl-devel libsecp256k1-devel
|
||||
```
|
||||
|
||||
**Install on macOS:**
|
||||
```bash
|
||||
brew install openssl curl secp256k1
|
||||
```
|
||||
|
||||
**Still Bundled:**
|
||||
- cJSON (JSON parsing - internal copy)
|
||||
- TinyAES-c (AES encryption for NIP-04)
|
||||
- ChaCha20 (stream cipher for NIP-44)
|
||||
|
||||
## 📚 API Documentation
|
||||
|
||||
@@ -232,20 +302,32 @@ publish_result_t* synchronous_publish_event_with_progress(const char** relay_url
|
||||
|
||||
### Relay Pools (Asynchronous)
|
||||
```c
|
||||
// Create and manage relay pool
|
||||
nostr_relay_pool_t* nostr_relay_pool_create(void);
|
||||
// Create and manage relay pool with reconnection
|
||||
nostr_pool_reconnect_config_t* config = nostr_pool_reconnect_config_default();
|
||||
nostr_relay_pool_t* nostr_relay_pool_create(nostr_pool_reconnect_config_t* config);
|
||||
int nostr_relay_pool_add_relay(nostr_relay_pool_t* pool, const char* relay_url);
|
||||
void nostr_relay_pool_destroy(nostr_relay_pool_t* pool);
|
||||
|
||||
// Subscribe to events
|
||||
// Subscribe to events (with auto-reconnection)
|
||||
nostr_pool_subscription_t* nostr_relay_pool_subscribe(
|
||||
nostr_relay_pool_t* pool, const char** relay_urls, int relay_count, cJSON* filter,
|
||||
void (*on_event)(cJSON* event, const char* relay_url, void* user_data),
|
||||
void (*on_eose)(void* user_data), void* user_data);
|
||||
void (*on_eose)(void* user_data), void* user_data, int close_on_eose);
|
||||
|
||||
// Run event loop
|
||||
// Run event loop (handles reconnection automatically)
|
||||
int nostr_relay_pool_run(nostr_relay_pool_t* pool, int timeout_ms);
|
||||
int nostr_relay_pool_poll(nostr_relay_pool_t* pool, int timeout_ms);
|
||||
|
||||
// Reconnection configuration
|
||||
typedef struct {
|
||||
int enable_auto_reconnect; // Enable automatic reconnection
|
||||
int max_reconnect_attempts; // Maximum retry attempts
|
||||
int initial_reconnect_delay_ms; // Initial delay between attempts
|
||||
int max_reconnect_delay_ms; // Maximum delay cap
|
||||
int reconnect_backoff_multiplier; // Exponential backoff factor
|
||||
int ping_interval_seconds; // Health check ping interval
|
||||
int pong_timeout_seconds; // Pong response timeout
|
||||
} nostr_pool_reconnect_config_t;
|
||||
```
|
||||
|
||||
### NIP-05 Identifier Verification
|
||||
@@ -300,6 +382,9 @@ The library includes extensive tests:
|
||||
|
||||
# Individual test categories
|
||||
cd tests && make test
|
||||
|
||||
# Interactive relay pool testing
|
||||
cd tests && ./pool_test
|
||||
```
|
||||
|
||||
**Test Categories:**
|
||||
@@ -313,54 +398,57 @@ cd tests && make test
|
||||
- **Relay Communication**: `relay_pool_test`, `sync_test`
|
||||
- **HTTP/WebSocket**: `http_test`, `wss_test`
|
||||
- **Proof of Work**: `test_pow_loop`
|
||||
- **Interactive Pool Testing**: `pool_test` (menu-driven interface with reconnection testing)
|
||||
|
||||
## 🏗️ Integration
|
||||
|
||||
### Static Library Integration
|
||||
### Static Library Integration (Recommended)
|
||||
|
||||
1. **Copy required files to your project:**
|
||||
1. **Install system dependencies first** (see Dependencies section above)
|
||||
|
||||
2. **Copy required files to your project:**
|
||||
```bash
|
||||
cp libnostr_core.a /path/to/your/project/
|
||||
cp nostr_core/nostr_core.h /path/to/your/project/
|
||||
```
|
||||
|
||||
2. **Link in your project:**
|
||||
3. **Link in your project:**
|
||||
```bash
|
||||
gcc your_code.c -L. -lnostr_core -lm -o your_program
|
||||
gcc your_code.c -L. -lnostr_core -lssl -lcrypto -lcurl -lsecp256k1 -lm -o your_program
|
||||
```
|
||||
|
||||
### Source Integration
|
||||
|
||||
1. **Copy source files:**
|
||||
1. **Install system dependencies first** (see Dependencies section above)
|
||||
|
||||
2. **Copy source files:**
|
||||
```bash
|
||||
cp -r nostr_core/ /path/to/your/project/
|
||||
cp -r cjson/ /path/to/your/project/
|
||||
```
|
||||
|
||||
2. **Include in your build:**
|
||||
3. **Include in your build:**
|
||||
```bash
|
||||
gcc your_code.c nostr_core/*.c cjson/cJSON.c -lm -o your_program
|
||||
gcc your_code.c nostr_core/*.c cjson/cJSON.c -lssl -lcrypto -lcurl -lsecp256k1 -lm -o your_program
|
||||
```
|
||||
|
||||
### Self-Contained Library
|
||||
### System Dependencies Library
|
||||
|
||||
**x64 Library:** The `libnostr_core.a` file is completely self-contained with **no external dependencies**:
|
||||
The `libnostr_core.a` library now uses **system dependencies** for all major crypto libraries:
|
||||
|
||||
- ✅ **All OpenSSL code embedded**
|
||||
- ✅ **No libwally required**
|
||||
- ✅ **No system secp256k1 required**
|
||||
- ✅ **Only needs math library (`-lm`)**
|
||||
- ✅ **Uses system OpenSSL** (`-lssl -lcrypto`)
|
||||
- ✅ **Uses system curl** (`-lcurl`)
|
||||
- ✅ **Uses system secp256k1** (`-lsecp256k1`)
|
||||
- ✅ **Includes only internal code** (cJSON, TinyAES, ChaCha20)
|
||||
|
||||
**Complete linking example:**
|
||||
```bash
|
||||
# x64 - This is all you need:
|
||||
gcc your_app.c ./libnostr_core.a -lm -o your_app
|
||||
gcc your_app.c ./libnostr_core.a -lssl -lcrypto -lcurl -lsecp256k1 -lm -o your_app
|
||||
```
|
||||
|
||||
**ARM64 Library:** The `libnostr_core_arm64.a` requires system OpenSSL:
|
||||
|
||||
**Check system dependencies:**
|
||||
```bash
|
||||
# ARM64 - Requires OpenSSL libraries:
|
||||
aarch64-linux-gnu-gcc your_app.c ./libnostr_core_arm64.a -lssl -lcrypto -lm -o your_app
|
||||
ldd your_app # Shows linked system libraries
|
||||
```
|
||||
|
||||
## 🔧 Configuration
|
||||
@@ -419,7 +507,7 @@ make arm64
|
||||
|
||||
## 📈 Version History
|
||||
|
||||
Current version: **0.1.20**
|
||||
Current version: **0.2.1**
|
||||
|
||||
The library uses automatic semantic versioning based on Git tags. Each build increments the patch version automatically.
|
||||
|
||||
@@ -427,13 +515,15 @@ The library uses automatic semantic versioning based on Git tags. Each build inc
|
||||
- **OpenSSL Migration**: Transitioned from mbedTLS to OpenSSL for improved compatibility
|
||||
- **NIP-05 Support**: DNS-based internet identifier verification
|
||||
- **NIP-11 Support**: Relay information document fetching and parsing
|
||||
- **NIP-19 Support**: Bech32-encoded entities (nsec/npub)
|
||||
- **Enhanced WebSocket**: OpenSSL-based TLS WebSocket communication
|
||||
- **Production Ready**: Comprehensive test suite and error handling
|
||||
- **Comprehensive Testing**: Extensive test suite and error handling
|
||||
|
||||
**Version Timeline:**
|
||||
- `v0.2.x` - Current development releases with enhanced NIP support
|
||||
- `v0.1.x` - Initial development releases
|
||||
- Focus on core protocol implementation and OpenSSL-based crypto
|
||||
- Full NIP-01, NIP-04, NIP-05, NIP-06, NIP-11, NIP-13, NIP-44 support
|
||||
- Full NIP-01, NIP-04, NIP-05, NIP-06, NIP-11, NIP-13, NIP-17, NIP-19, NIP-42, NIP-44, NIP-59 support
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
@@ -441,16 +531,24 @@ The library uses automatic semantic versioning based on Git tags. Each build inc
|
||||
|
||||
**Build fails with secp256k1 errors:**
|
||||
```bash
|
||||
# Install secp256k1 with Schnorr support
|
||||
sudo apt install libsecp256k1-dev # Ubuntu/Debian
|
||||
# or
|
||||
sudo yum install libsecp256k1-devel # CentOS/RHEL
|
||||
# or
|
||||
brew install secp256k1 # macOS
|
||||
|
||||
# If still failing, build from source with Schnorr support:
|
||||
git clone https://github.com/bitcoin-core/secp256k1.git
|
||||
cd secp256k1
|
||||
./autogen.sh
|
||||
./configure --enable-module-schnorrsig --enable-module-ecdh
|
||||
make
|
||||
cd ..
|
||||
./build.sh lib
|
||||
sudo make install
|
||||
```
|
||||
|
||||
**Library too large:**
|
||||
The x64 library is intentionally large (~15MB) because it includes all secp256k1 cryptographic functions and OpenSSL for complete self-containment. The ARM64 library is smaller (~2.4MB) as it links against system OpenSSL.
|
||||
**Library size:**
|
||||
The library is small (~500KB) as it links against system libraries (secp256k1, OpenSSL, curl) rather than including them statically. This keeps the binary size manageable while maintaining full functionality.
|
||||
|
||||
**Linking errors:**
|
||||
Make sure to include the math library:
|
||||
@@ -481,4 +579,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
||||
|
||||
**Built with ❤️ for the decentralized web**
|
||||
|
||||
*OpenSSL-based • Minimal dependencies • Production ready*
|
||||
*OpenSSL-based • Minimal dependencies • Work in progress*
|
||||
|
||||
366
build.sh
366
build.sh
@@ -58,6 +58,7 @@ FORCE_NIPS=""
|
||||
VERBOSE=false
|
||||
HELP=false
|
||||
BUILD_TESTS=false
|
||||
BUILD_EXAMPLES=false
|
||||
NO_COLOR_FLAG=false
|
||||
|
||||
# Parse command line arguments
|
||||
@@ -83,6 +84,10 @@ while [[ $# -gt 0 ]]; do
|
||||
BUILD_TESTS=true
|
||||
shift
|
||||
;;
|
||||
--examples|-e)
|
||||
BUILD_EXAMPLES=true
|
||||
shift
|
||||
;;
|
||||
--no-color)
|
||||
NO_COLOR_FLAG=true
|
||||
shift
|
||||
@@ -119,6 +124,7 @@ if [ "$HELP" = true ]; then
|
||||
echo " --nips=1,5,6,19 Force specific NIPs (comma-separated)"
|
||||
echo " --nips=all Include all available NIPs"
|
||||
echo " --tests, -t Build all test programs in tests/ directory"
|
||||
echo " --examples, -e Build all example programs in examples/ directory"
|
||||
echo " --verbose, -v Verbose output"
|
||||
echo " --no-color Disable colored output"
|
||||
echo " --help, -h Show this help"
|
||||
@@ -129,12 +135,17 @@ if [ "$HELP" = true ]; then
|
||||
echo ""
|
||||
echo "Available NIPs:"
|
||||
echo " 001 - Basic Protocol (event creation, signing)"
|
||||
echo " 004 - Encryption (legacy)"
|
||||
echo " 005 - DNS-based identifiers"
|
||||
echo " 006 - Key derivation from mnemonic"
|
||||
echo " 011 - Relay information document"
|
||||
echo " 013 - Proof of Work"
|
||||
echo " 017 - Private Direct Messages"
|
||||
echo " 019 - Bech32 encoding (nsec/npub)"
|
||||
echo " 044 - Encryption"
|
||||
echo " 021 - nostr: URI scheme"
|
||||
echo " 042 - Authentication of clients to relays"
|
||||
echo " 044 - Encryption (modern)"
|
||||
echo " 059 - Gift Wrap"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " $0 # Auto-detect NIPs, build for current arch"
|
||||
@@ -148,10 +159,13 @@ fi
|
||||
print_info "NOSTR Core Library - Customer Build Script"
|
||||
|
||||
# Check if we're running from the correct directory
|
||||
if [ ! -d "nostr_core" ] || [ ! -f "nostr_core/utils.c" ] || [ ! -d "secp256k1" ]; then
|
||||
CURRENT_DIR=$(basename "$(pwd)")
|
||||
if [ "$CURRENT_DIR" != "nostr_core_lib" ]; then
|
||||
print_error "Build script must be run from the nostr_core_lib directory"
|
||||
echo ""
|
||||
echo "It looks like you're trying to run this script from your project directory."
|
||||
echo "Current directory: $CURRENT_DIR"
|
||||
echo "Expected directory: nostr_core_lib"
|
||||
echo ""
|
||||
echo "Please change to the nostr_core_lib directory first, then run the build script."
|
||||
echo ""
|
||||
echo "Correct usage:"
|
||||
@@ -162,7 +176,7 @@ if [ ! -d "nostr_core" ] || [ ! -f "nostr_core/utils.c" ] || [ ! -d "secp256k1"
|
||||
echo " cd nostr_core_lib"
|
||||
echo " ./build.sh"
|
||||
echo " cd .."
|
||||
echo " gcc your_app.c nostr_core_lib/libnostr_core_x64.a -lz -ldl -lpthread -lm -o your_app"
|
||||
echo " gcc your_app.c nostr_core_lib/libnostr_core_x64.a -lz -ldl -lpthread -lm -lssl -lcrypto -lcurl -lsecp256k1 -o your_app"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
@@ -180,7 +194,7 @@ print_info "Auto-detecting needed NIPs from your source code..."
|
||||
NEEDED_NIPS=""
|
||||
if [ -n "$FORCE_NIPS" ]; then
|
||||
if [ "$FORCE_NIPS" = "all" ]; then
|
||||
NEEDED_NIPS="001 004 005 006 011 013 019 044"
|
||||
NEEDED_NIPS="001 004 005 006 011 013 017 019 042 044 059"
|
||||
print_info "Forced: Building all available NIPs"
|
||||
else
|
||||
# Convert comma-separated list to space-separated with 3-digit format
|
||||
@@ -199,7 +213,7 @@ else
|
||||
# Check for nostr_core.h (includes everything)
|
||||
if grep -q '#include[[:space:]]*["\<]nostr_core\.h["\>]' *.c 2>/dev/null; then
|
||||
print_info "Found #include \"nostr_core.h\" - building all NIPs"
|
||||
NEEDED_NIPS="001 005 006 011 013 019 044"
|
||||
NEEDED_NIPS="001 004 005 006 011 013 019 042 044"
|
||||
elif [ -n "$DETECTED" ]; then
|
||||
NEEDED_NIPS="$DETECTED"
|
||||
print_success "Auto-detected NIPs: $(echo $NEEDED_NIPS | tr ' ' ',')"
|
||||
@@ -215,10 +229,10 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# If building tests, include all NIPs to ensure test compatibility
|
||||
if [ "$BUILD_TESTS" = true ] && [ -z "$FORCE_NIPS" ]; then
|
||||
NEEDED_NIPS="001 005 006 011 013 019 044"
|
||||
print_info "Building tests - including all available NIPs for test compatibility"
|
||||
# If building tests or examples, include all NIPs to ensure compatibility
|
||||
if ([ "$BUILD_TESTS" = true ] || [ "$BUILD_EXAMPLES" = true ]) && [ -z "$FORCE_NIPS" ]; then
|
||||
NEEDED_NIPS="001 004 005 006 011 013 017 019 021 042 044 059"
|
||||
print_info "Building tests/examples - including all available NIPs for compatibility"
|
||||
fi
|
||||
|
||||
# Ensure NIP-001 is always included (required for core functionality)
|
||||
@@ -281,6 +295,198 @@ fi
|
||||
|
||||
|
||||
|
||||
###########################################################################################
|
||||
###########################################################################################
|
||||
############ CHECK AND BUILD DEPENDENCIES BASED ON NEEDED NIPS
|
||||
###########################################################################################
|
||||
###########################################################################################
|
||||
|
||||
print_info "Checking dependencies based on needed NIPs..."
|
||||
|
||||
# Determine which dependencies are needed based on NIPs
|
||||
NEED_SECP256K1=false
|
||||
NEED_OPENSSL=false
|
||||
NEED_CURL=false
|
||||
|
||||
# secp256k1 is always needed (core cryptography for NIP-001)
|
||||
NEED_SECP256K1=true
|
||||
|
||||
# Check if network-dependent NIPs are included
|
||||
NETWORK_NIPS="005 011" # NIP-005 (DNS), NIP-011 (Relay info)
|
||||
for nip in $NEEDED_NIPS; do
|
||||
case $nip in
|
||||
005|011)
|
||||
NEED_CURL=true
|
||||
print_info "NIP-$nip requires HTTP functionality - curl needed"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# WebSocket functionality is always enabled (using system OpenSSL)
|
||||
NEED_OPENSSL=true
|
||||
NEED_CURL=true
|
||||
print_info "WebSocket functionality enabled - system OpenSSL and curl required"
|
||||
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_info "Dependency requirements:"
|
||||
[ "$NEED_SECP256K1" = true ] && echo " ✓ secp256k1 (core crypto)"
|
||||
[ "$NEED_OPENSSL" = true ] && echo " ✓ OpenSSL (TLS/WebSocket)"
|
||||
[ "$NEED_CURL" = true ] && echo " ✓ curl (HTTP requests)"
|
||||
fi
|
||||
|
||||
# Function to detect system secp256k1
|
||||
detect_system_secp256k1() {
|
||||
if [ "$NEED_SECP256K1" != true ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
print_info "Detecting system secp256k1..."
|
||||
|
||||
# Try pkg-config first
|
||||
if command -v pkg-config >/dev/null 2>&1 && pkg-config --exists libsecp256k1; then
|
||||
SECP256K1_CFLAGS=$(pkg-config --cflags libsecp256k1)
|
||||
SECP256K1_LIBS=$(pkg-config --libs libsecp256k1)
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_success "Found secp256k1 via pkg-config"
|
||||
print_info " CFLAGS: $SECP256K1_CFLAGS"
|
||||
print_info " LIBS: $SECP256K1_LIBS"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Fallback to standard locations
|
||||
SECP256K1_CFLAGS=""
|
||||
SECP256K1_LIBS="-lsecp256k1"
|
||||
|
||||
# Check common header locations
|
||||
for header_path in /usr/include/secp256k1.h /usr/local/include/secp256k1.h; do
|
||||
if [ -f "$header_path" ]; then
|
||||
if [ "$header_path" != "/usr/include/secp256k1.h" ]; then
|
||||
SECP256K1_CFLAGS="-I$(dirname $header_path)"
|
||||
fi
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_success "Found secp256k1 headers at: $header_path"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if we can find the libraries
|
||||
if ! echo '#include <secp256k1.h>' | gcc $SECP256K1_CFLAGS -E - >/dev/null 2>&1; then
|
||||
print_error "secp256k1 development headers not found"
|
||||
print_info "Install with: sudo apt install libsecp256k1-dev (Ubuntu/Debian)"
|
||||
print_info " sudo yum install libsecp256k1-devel (CentOS/RHEL)"
|
||||
print_info " brew install secp256k1 (macOS)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_success "System secp256k1 detected"
|
||||
}
|
||||
|
||||
# Function to detect system OpenSSL
|
||||
detect_system_openssl() {
|
||||
if [ "$NEED_OPENSSL" != true ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
print_info "Detecting system OpenSSL..."
|
||||
|
||||
# Try pkg-config first
|
||||
if command -v pkg-config >/dev/null 2>&1 && pkg-config --exists openssl; then
|
||||
OPENSSL_CFLAGS=$(pkg-config --cflags openssl)
|
||||
OPENSSL_LIBS=$(pkg-config --libs openssl)
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_success "Found OpenSSL via pkg-config"
|
||||
print_info " CFLAGS: $OPENSSL_CFLAGS"
|
||||
print_info " LIBS: $OPENSSL_LIBS"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Fallback to standard locations
|
||||
OPENSSL_CFLAGS=""
|
||||
OPENSSL_LIBS="-lssl -lcrypto"
|
||||
|
||||
# Check common header locations
|
||||
for header_path in /usr/include/openssl /usr/local/include/openssl; do
|
||||
if [ -f "$header_path/ssl.h" ]; then
|
||||
if [ "$header_path" != "/usr/include/openssl" ]; then
|
||||
OPENSSL_CFLAGS="-I$(dirname $header_path)"
|
||||
fi
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_success "Found OpenSSL headers at: $header_path"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if we can find the libraries
|
||||
if ! echo '#include <openssl/ssl.h>' | gcc $OPENSSL_CFLAGS -E - >/dev/null 2>&1; then
|
||||
print_error "OpenSSL development headers not found"
|
||||
print_info "Install with: sudo apt install libssl-dev (Ubuntu/Debian)"
|
||||
print_info " sudo yum install openssl-devel (CentOS/RHEL)"
|
||||
print_info " brew install openssl (macOS)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_success "System OpenSSL detected"
|
||||
}
|
||||
|
||||
# Function to detect system curl
|
||||
detect_system_curl() {
|
||||
if [ "$NEED_CURL" != true ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
print_info "Detecting system curl..."
|
||||
|
||||
# Try pkg-config first
|
||||
if command -v pkg-config >/dev/null 2>&1 && pkg-config --exists libcurl; then
|
||||
CURL_CFLAGS=$(pkg-config --cflags libcurl)
|
||||
CURL_LIBS=$(pkg-config --libs libcurl)
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_success "Found curl via pkg-config"
|
||||
print_info " CFLAGS: $CURL_CFLAGS"
|
||||
print_info " LIBS: $CURL_LIBS"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Fallback to standard locations
|
||||
CURL_CFLAGS=""
|
||||
CURL_LIBS="-lcurl"
|
||||
|
||||
# Check common header locations
|
||||
for header_path in /usr/include/curl /usr/local/include/curl; do
|
||||
if [ -f "$header_path/curl.h" ]; then
|
||||
if [ "$header_path" != "/usr/include/curl" ]; then
|
||||
CURL_CFLAGS="-I$(dirname $header_path)"
|
||||
fi
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_success "Found curl headers at: $header_path"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if we can find the libraries
|
||||
if ! echo '#include <curl/curl.h>' | gcc $CURL_CFLAGS -E - >/dev/null 2>&1; then
|
||||
print_error "curl development headers not found"
|
||||
print_info "Install with: sudo apt install libcurl4-openssl-dev (Ubuntu/Debian)"
|
||||
print_info " sudo yum install libcurl-devel (CentOS/RHEL)"
|
||||
print_info " brew install curl (macOS)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_success "System curl detected"
|
||||
}
|
||||
|
||||
# Build only the needed dependencies
|
||||
detect_system_secp256k1
|
||||
detect_system_openssl
|
||||
detect_system_curl
|
||||
|
||||
|
||||
###########################################################################################
|
||||
###########################################################################################
|
||||
############ ADD CORE DEPENDENCIES THAT NEED TO BE BUILT TO THE $SOURCES VARIABLE
|
||||
@@ -294,17 +500,10 @@ SOURCES="$SOURCES cjson/cJSON.c"
|
||||
SOURCES="$SOURCES nostr_core/utils.c"
|
||||
SOURCES="$SOURCES nostr_core/nostr_common.c"
|
||||
SOURCES="$SOURCES nostr_core/core_relays.c"
|
||||
SOURCES="$SOURCES nostr_core/core_relay_pool.c"
|
||||
SOURCES="$SOURCES nostr_websocket/nostr_websocket_openssl.c"
|
||||
SOURCES="$SOURCES nostr_core/request_validator.c"
|
||||
|
||||
# Add secp256k1 library path based on architecture
|
||||
case $ARCHITECTURE in
|
||||
x64)
|
||||
SECP256K1_LIB="secp256k1/.libs/libsecp256k1.a"
|
||||
;;
|
||||
arm64)
|
||||
SECP256K1_LIB="secp256k1/.libs/libsecp256k1_arm64.a"
|
||||
;;
|
||||
esac
|
||||
NIP_DESCRIPTIONS=""
|
||||
|
||||
for nip in $NEEDED_NIPS; do
|
||||
@@ -318,8 +517,12 @@ for nip in $NEEDED_NIPS; do
|
||||
006) NIP_DESCRIPTIONS="$NIP_DESCRIPTIONS NIP-006(Keys)" ;;
|
||||
011) NIP_DESCRIPTIONS="$NIP_DESCRIPTIONS NIP-011(Relay-Info)" ;;
|
||||
013) NIP_DESCRIPTIONS="$NIP_DESCRIPTIONS NIP-013(PoW)" ;;
|
||||
017) NIP_DESCRIPTIONS="$NIP_DESCRIPTIONS NIP-017(DMs)" ;;
|
||||
019) NIP_DESCRIPTIONS="$NIP_DESCRIPTIONS NIP-019(Bech32)" ;;
|
||||
021) NIP_DESCRIPTIONS="$NIP_DESCRIPTIONS NIP-021(URI)" ;;
|
||||
042) NIP_DESCRIPTIONS="$NIP_DESCRIPTIONS NIP-042(Auth)" ;;
|
||||
044) NIP_DESCRIPTIONS="$NIP_DESCRIPTIONS NIP-044(Encrypt)" ;;
|
||||
059) NIP_DESCRIPTIONS="$NIP_DESCRIPTIONS NIP-059(Gift-Wrap)" ;;
|
||||
esac
|
||||
else
|
||||
print_warning "NIP file not found: $NIP_FILE - skipping"
|
||||
@@ -329,12 +532,30 @@ done
|
||||
# Build flags
|
||||
CFLAGS="-Wall -Wextra -std=c99 -fPIC -O2"
|
||||
CFLAGS="$CFLAGS -DENABLE_FILE_LOGGING -DENABLE_WEBSOCKET_LOGGING -DENABLE_DEBUG_LOGGING"
|
||||
INCLUDES="-I. -Inostr_core -Inostr_core/crypto -Icjson -Isecp256k1/include -Inostr_websocket"
|
||||
INCLUDES="$INCLUDES -I./openssl-install/include -I./curl-install/include"
|
||||
INCLUDES="-I. -Inostr_core -Inostr_core/crypto -Icjson -Inostr_websocket"
|
||||
|
||||
# Static libraries
|
||||
STATIC_LIBS="./openssl-install/lib64/libssl.a ./openssl-install/lib64/libcrypto.a"
|
||||
STATIC_LIBS="$STATIC_LIBS ./curl-install/lib/libcurl.a"
|
||||
# Add system library includes
|
||||
if [ -n "$SECP256K1_CFLAGS" ]; then
|
||||
INCLUDES="$INCLUDES $SECP256K1_CFLAGS"
|
||||
fi
|
||||
if [ -n "$OPENSSL_CFLAGS" ]; then
|
||||
INCLUDES="$INCLUDES $OPENSSL_CFLAGS"
|
||||
fi
|
||||
if [ -n "$CURL_CFLAGS" ]; then
|
||||
INCLUDES="$INCLUDES $CURL_CFLAGS"
|
||||
fi
|
||||
|
||||
# System libraries
|
||||
SYSTEM_LIBS=""
|
||||
if [ -n "$SECP256K1_LIBS" ]; then
|
||||
SYSTEM_LIBS="$SYSTEM_LIBS $SECP256K1_LIBS"
|
||||
fi
|
||||
if [ -n "$OPENSSL_LIBS" ]; then
|
||||
SYSTEM_LIBS="$SYSTEM_LIBS $OPENSSL_LIBS"
|
||||
fi
|
||||
if [ -n "$CURL_LIBS" ]; then
|
||||
SYSTEM_LIBS="$SYSTEM_LIBS $CURL_LIBS"
|
||||
fi
|
||||
|
||||
# Output library name
|
||||
OUTPUT="libnostr_core_${ARCH_SUFFIX}.a"
|
||||
@@ -386,54 +607,17 @@ done
|
||||
############ BY LINKING IN ALL OUR .o FILES THAT ARE REQUESTED TO BE ADDED.
|
||||
###########################################################################################
|
||||
###########################################################################################
|
||||
print_info "Creating self-contained static library: $OUTPUT"
|
||||
|
||||
# Store the build directory to ensure correct paths when extracting from subdirectories
|
||||
BUILD_DIR=$(pwd)
|
||||
|
||||
# Create temporary directories for extracting objects
|
||||
TMP_SECP256K1=".tmp_secp256k1_$$"
|
||||
TMP_OPENSSL=".tmp_openssl_$$"
|
||||
TMP_CURL=".tmp_curl_$$"
|
||||
|
||||
mkdir -p "$TMP_SECP256K1" "$TMP_OPENSSL" "$TMP_CURL"
|
||||
|
||||
# Extract secp256k1 objects
|
||||
if [ -f "$SECP256K1_LIB" ]; then
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_info "Extracting secp256k1 objects..."
|
||||
fi
|
||||
(cd "$TMP_SECP256K1" && ar x "$BUILD_DIR/$SECP256K1_LIB")
|
||||
fi
|
||||
|
||||
# Extract OpenSSL objects
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_info "Extracting OpenSSL objects..."
|
||||
fi
|
||||
(cd "$TMP_OPENSSL" && ar x "$BUILD_DIR/openssl-install/lib64/libssl.a")
|
||||
(cd "$TMP_OPENSSL" && ar x "$BUILD_DIR/openssl-install/lib64/libcrypto.a")
|
||||
|
||||
# Extract curl objects
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_info "Extracting curl objects..."
|
||||
fi
|
||||
(cd "$TMP_CURL" && ar x "$BUILD_DIR/curl-install/lib/libcurl.a")
|
||||
|
||||
# Combine all objects into final library
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_info "Combining all objects into self-contained library..."
|
||||
fi
|
||||
print_info "Creating static library with system dependencies: $OUTPUT"
|
||||
|
||||
# Note: All crypto libraries (secp256k1, OpenSSL, curl) are now system dependencies
|
||||
# Only our own object files are included in the static library
|
||||
|
||||
#########################################################
|
||||
### THE ACTUAL COMMAND TO LINK .o FILES INTO A .a FILE
|
||||
#########################################################
|
||||
ar rcs "$OUTPUT" $OBJECTS "$TMP_SECP256K1"/*.o "$TMP_OPENSSL"/*.o "$TMP_CURL"/*.o
|
||||
ar rcs "$OUTPUT" $OBJECTS
|
||||
AR_RESULT=$?
|
||||
|
||||
# Cleanup temporary directories
|
||||
rm -rf "$TMP_SECP256K1" "$TMP_OPENSSL" "$TMP_CURL"
|
||||
|
||||
|
||||
|
||||
###########################################################################################
|
||||
@@ -468,8 +652,8 @@ if [ $AR_RESULT -eq 0 ]; then
|
||||
|
||||
print_info "Building test: $test_name"
|
||||
|
||||
# Simple test compilation - everything is in our fat library
|
||||
LINK_FLAGS="-lz -ldl -lpthread -lm -static"
|
||||
# Test compilation with system libraries
|
||||
LINK_FLAGS="-lz -ldl -lpthread -lm $SYSTEM_LIBS"
|
||||
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_info " Command: $CC $CFLAGS $INCLUDES \"$test_file\" -o \"$test_exe\" ./$OUTPUT $LINK_FLAGS"
|
||||
@@ -496,8 +680,54 @@ if [ $AR_RESULT -eq 0 ]; then
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Build examples if requested
|
||||
if [ "$BUILD_EXAMPLES" = true ]; then
|
||||
print_info "Scanning examples/ directory for example programs..."
|
||||
|
||||
if [ ! -d "examples" ]; then
|
||||
print_warning "examples/ directory not found - skipping example builds"
|
||||
else
|
||||
EXAMPLE_COUNT=0
|
||||
SUCCESS_COUNT=0
|
||||
|
||||
# Find all .c files in examples/ directory (not subdirectories)
|
||||
while IFS= read -r -d '' example_file; do
|
||||
EXAMPLE_COUNT=$((EXAMPLE_COUNT + 1))
|
||||
example_name=$(basename "$example_file" .c)
|
||||
example_exe="examples/$example_name"
|
||||
|
||||
print_info "Building example: $example_name"
|
||||
|
||||
# Example compilation with system libraries
|
||||
LINK_FLAGS="-lz -ldl -lpthread -lm $SYSTEM_LIBS"
|
||||
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_info " Command: $CC $CFLAGS $INCLUDES \"$example_file\" -o \"$example_exe\" ./$OUTPUT $LINK_FLAGS"
|
||||
fi
|
||||
|
||||
if $CC $CFLAGS $INCLUDES "$example_file" -o "$example_exe" "./$OUTPUT" $LINK_FLAGS; then
|
||||
SUCCESS_COUNT=$((SUCCESS_COUNT + 1))
|
||||
print_success "Built $example_name"
|
||||
if [ "$VERBOSE" = true ]; then
|
||||
print_info " Executable: $example_exe"
|
||||
fi
|
||||
else
|
||||
print_error " Failed to build: $example_name"
|
||||
fi
|
||||
|
||||
done < <(find examples/ -maxdepth 1 -name "*.c" -type f -print0)
|
||||
|
||||
if [ $EXAMPLE_COUNT -eq 0 ]; then
|
||||
print_warning "No .c files found in examples/ directory"
|
||||
else
|
||||
print_success "Built $SUCCESS_COUNT/$EXAMPLE_COUNT example programs"
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "Usage in your project:"
|
||||
echo " gcc your_app.c $OUTPUT -lz -ldl -lpthread -lm -o your_app"
|
||||
echo " gcc your_app.c $OUTPUT -lz -ldl -lpthread -lm $SYSTEM_LIBS -o your_app"
|
||||
echo ""
|
||||
else
|
||||
print_error "Failed to create static library"
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
In a release tarball, check the RELEASES-NOTES file for what was done in the
|
||||
most recent release. In a git check-out, that file mentions changes that have
|
||||
been done since the previous release.
|
||||
|
||||
See the online [changelog](https://curl.se/changes.html) for the edited and
|
||||
human readable version of what has changed in different curl releases.
|
||||
@@ -1,24 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
@CMAKE_CONFIGURABLE_FILE_CONTENT@
|
||||
@@ -1,68 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
option(CURL_HIDDEN_SYMBOLS "Hide libcurl internal symbols (=hide all symbols that are not officially external)" ON)
|
||||
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
|
||||
|
||||
if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG))
|
||||
# We need to export internal debug functions,
|
||||
# e.g. curl_easy_perform_ev() or curl_dbg_*(),
|
||||
# so disable symbol hiding for debug builds and for memory tracking.
|
||||
set(CURL_HIDDEN_SYMBOLS OFF)
|
||||
elseif(DOS OR AMIGA OR MINGW32CE)
|
||||
set(CURL_HIDDEN_SYMBOLS OFF)
|
||||
endif()
|
||||
|
||||
set(CURL_HIDES_PRIVATE_SYMBOLS FALSE)
|
||||
set(CURL_EXTERN_SYMBOL "")
|
||||
set(CURL_CFLAG_SYMBOLS_HIDE "")
|
||||
|
||||
if(CURL_HIDDEN_SYMBOLS)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT MSVC)
|
||||
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
|
||||
set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))")
|
||||
set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
|
||||
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.4)
|
||||
# Note: This is considered buggy prior to 4.0 but the autotools do not care, so let us ignore that fact
|
||||
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
|
||||
set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))")
|
||||
set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
|
||||
endif()
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "SunPro" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
|
||||
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
|
||||
set(CURL_EXTERN_SYMBOL "__global")
|
||||
set(CURL_CFLAG_SYMBOLS_HIDE "-xldscope=hidden")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0) # Requires 9.1.045
|
||||
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
|
||||
set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))")
|
||||
set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
|
||||
elseif(MSVC)
|
||||
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
|
||||
endif()
|
||||
else()
|
||||
if(MSVC)
|
||||
# Note: This option is prone to export non-curl extra symbols.
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,392 +0,0 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef HAVE_FCNTL_O_NONBLOCK
|
||||
/* headers for FCNTL_O_NONBLOCK test */
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
/* */
|
||||
#if defined(sun) || defined(__sun__) || \
|
||||
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
# if defined(__SVR4) || defined(__srv4__)
|
||||
# define PLATFORM_SOLARIS
|
||||
# else
|
||||
# define PLATFORM_SUNOS4
|
||||
# endif
|
||||
#endif
|
||||
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
|
||||
# define PLATFORM_AIX_V3
|
||||
#endif
|
||||
/* */
|
||||
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3)
|
||||
#error "O_NONBLOCK does not work on this platform"
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* O_NONBLOCK source test */
|
||||
int flags = 0;
|
||||
if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* tests for gethostbyname_r */
|
||||
#if defined(HAVE_GETHOSTBYNAME_R_3) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_5) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
int main(void)
|
||||
{
|
||||
const char *address = "example.com";
|
||||
struct hostent h;
|
||||
int rc = 0;
|
||||
#if defined(HAVE_GETHOSTBYNAME_R_3) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT)
|
||||
struct hostent_data hdata;
|
||||
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
|
||||
char buffer[8192];
|
||||
struct hostent *hp;
|
||||
int h_errnop;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_GETHOSTBYNAME_R_3) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT)
|
||||
rc = gethostbyname_r(address, &h, &hdata);
|
||||
(void)hdata;
|
||||
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT)
|
||||
rc = gethostbyname_r(address, &h, buffer, 8192, &h_errnop);
|
||||
(void)hp; /* not used for test */
|
||||
(void)h_errnop;
|
||||
#elif defined(HAVE_GETHOSTBYNAME_R_6) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
|
||||
rc = gethostbyname_r(address, &h, buffer, 8192, &hp, &h_errnop);
|
||||
(void)hp;
|
||||
(void)h_errnop;
|
||||
#endif
|
||||
(void)h;
|
||||
(void)rc;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BOOL_T
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
int main(void)
|
||||
{
|
||||
return (int)sizeof(bool *);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <float.h>
|
||||
int main(void) { return 0; }
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FILE_OFFSET_BITS
|
||||
#include <sys/types.h>
|
||||
/* Check that off_t can represent 2**63 - 1 correctly.
|
||||
We cannot simply define LARGE_OFF_T to be 9223372036854775807,
|
||||
since some C++ compilers masquerading as C compilers
|
||||
incorrectly reject 9223372036854775807. */
|
||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
static int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 &&
|
||||
LARGE_OFF_T % 2147483647 == 1)
|
||||
? 1 : -1];
|
||||
int main(void)
|
||||
{
|
||||
(void)off_t_is_large;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IOCTLSOCKET
|
||||
#ifdef _WIN32
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
int main(void)
|
||||
{
|
||||
/* ioctlsocket source code */
|
||||
int socket = -1;
|
||||
unsigned long flags = ioctlsocket(socket, FIONBIO, &flags);
|
||||
(void)flags;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IOCTLSOCKET_CAMEL
|
||||
#include <proto/bsdsocket.h>
|
||||
int main(void)
|
||||
{
|
||||
/* IoctlSocket source code */
|
||||
if(0 != IoctlSocket(0, 0, 0))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
|
||||
#include <proto/bsdsocket.h>
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
int main(void)
|
||||
{
|
||||
/* IoctlSocket source code */
|
||||
long flags = 0;
|
||||
if(0 != IoctlSocket(0, FIONBIO, &flags))
|
||||
return 1;
|
||||
(void)flags;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IOCTLSOCKET_FIONBIO
|
||||
#ifdef _WIN32
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
int main(void)
|
||||
{
|
||||
unsigned long flags = 0;
|
||||
if(0 != ioctlsocket(0, FIONBIO, &flags))
|
||||
return 1;
|
||||
(void)flags;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IOCTL_FIONBIO
|
||||
/* headers for FIONBIO test */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_STROPTS_H
|
||||
# include <stropts.h>
|
||||
#endif
|
||||
int main(void)
|
||||
{
|
||||
int flags = 0;
|
||||
if(0 != ioctl(0, FIONBIO, &flags))
|
||||
return 1;
|
||||
(void)flags;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IOCTL_SIOCGIFADDR
|
||||
/* headers for FIONBIO test */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_STROPTS_H
|
||||
# include <stropts.h>
|
||||
#endif
|
||||
#include <net/if.h>
|
||||
int main(void)
|
||||
{
|
||||
struct ifreq ifr;
|
||||
if(0 != ioctl(0, SIOCGIFADDR, &ifr))
|
||||
return 1;
|
||||
(void)ifr;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SETSOCKOPT_SO_NONBLOCK
|
||||
#ifdef _WIN32
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
int main(void)
|
||||
{
|
||||
if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GLIBC_STRERROR_R
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
static void check(char c) { (void)c; }
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char buffer[1024];
|
||||
/* This will not compile if strerror_r does not return a char* */
|
||||
/* !checksrc! disable ERRNOVAR 1 */
|
||||
check(strerror_r(EACCES, buffer, sizeof(buffer))[0]);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POSIX_STRERROR_R
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* Float, because a pointer cannot be implicitly cast to float */
|
||||
static void check(float f) { (void)f; }
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char buffer[1024];
|
||||
/* This will not compile if strerror_r does not return an int */
|
||||
/* !checksrc! disable ERRNOVAR 1 */
|
||||
check(strerror_r(EACCES, buffer, sizeof(buffer)));
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FSETXATTR_6
|
||||
#include <sys/xattr.h> /* header from libc, not from libattr */
|
||||
int main(void)
|
||||
{
|
||||
fsetxattr(0, 0, 0, 0, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FSETXATTR_5
|
||||
#include <sys/xattr.h> /* header from libc, not from libattr */
|
||||
int main(void)
|
||||
{
|
||||
fsetxattr(0, "", 0, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CLOCK_GETTIME_MONOTONIC
|
||||
#include <time.h>
|
||||
int main(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
(void)clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
(void)ts;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BUILTIN_AVAILABLE
|
||||
int main(void)
|
||||
{
|
||||
if(__builtin_available(macOS 10.12, iOS 5.0, *)) {}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ATOMIC
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDATOMIC_H
|
||||
# include <stdatomic.h>
|
||||
#endif
|
||||
int main(void)
|
||||
{
|
||||
_Atomic int i = 1;
|
||||
i = 0; /* Force an atomic-write operation. */
|
||||
return i;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WIN32_WINNT
|
||||
#ifdef _WIN32
|
||||
# ifndef NOGDI
|
||||
# define NOGDI
|
||||
# endif
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#define enquote(x) #x
|
||||
#define expand(x) enquote(x)
|
||||
#pragma message("_WIN32_WINNT=" expand(_WIN32_WINNT))
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MINGW64_VERSION
|
||||
#ifdef __MINGW32__
|
||||
# include <_mingw.h>
|
||||
#endif
|
||||
|
||||
#define enquote(x) #x
|
||||
#define expand(x) enquote(x)
|
||||
#pragma message("MINGW64_VERSION=" \
|
||||
expand(__MINGW64_VERSION_MAJOR) "." \
|
||||
expand(__MINGW64_VERSION_MINOR))
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -1,76 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the brotli library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `BROTLI_INCLUDE_DIR`: The brotli include directory.
|
||||
# - `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library.
|
||||
# - `BROTLIDEC_LIBRARY`: Path to `brotlidec` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `BROTLI_FOUND`: System has brotli.
|
||||
# - `BROTLI_INCLUDE_DIRS`: The brotli include directories.
|
||||
# - `BROTLI_LIBRARIES`: The brotli library names.
|
||||
# - `BROTLI_LIBRARY_DIRS`: The brotli library directories.
|
||||
# - `BROTLI_PC_REQUIRES`: The brotli pkg-config packages.
|
||||
# - `BROTLI_CFLAGS`: Required compiler flags.
|
||||
# - `BROTLI_VERSION`: Version of brotli.
|
||||
|
||||
set(BROTLI_PC_REQUIRES "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED BROTLI_INCLUDE_DIR AND
|
||||
NOT DEFINED BROTLICOMMON_LIBRARY AND
|
||||
NOT DEFINED BROTLIDEC_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(BROTLI ${BROTLI_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(BROTLI_FOUND)
|
||||
set(Brotli_FOUND TRUE)
|
||||
set(BROTLI_VERSION "${BROTLI_libbrotlicommon_VERSION}")
|
||||
string(REPLACE ";" " " BROTLI_CFLAGS "${BROTLI_CFLAGS}")
|
||||
message(STATUS "Found Brotli (via pkg-config): ${BROTLI_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")")
|
||||
else()
|
||||
find_path(BROTLI_INCLUDE_DIR "brotli/decode.h")
|
||||
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
|
||||
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Brotli
|
||||
REQUIRED_VARS
|
||||
BROTLI_INCLUDE_DIR
|
||||
BROTLIDEC_LIBRARY
|
||||
BROTLICOMMON_LIBRARY
|
||||
)
|
||||
|
||||
if(BROTLI_FOUND)
|
||||
set(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
|
||||
set(BROTLI_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(BROTLI_INCLUDE_DIR BROTLIDEC_LIBRARY BROTLICOMMON_LIBRARY)
|
||||
endif()
|
||||
@@ -1,97 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the c-ares library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `CARES_INCLUDE_DIR`: The c-ares include directory.
|
||||
# - `CARES_LIBRARY`: Path to `cares` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `CARES_FOUND`: System has c-ares.
|
||||
# - `CARES_INCLUDE_DIRS`: The c-ares include directories.
|
||||
# - `CARES_LIBRARIES`: The c-ares library names.
|
||||
# - `CARES_LIBRARY_DIRS`: The c-ares library directories.
|
||||
# - `CARES_PC_REQUIRES`: The c-ares pkg-config packages.
|
||||
# - `CARES_CFLAGS`: Required compiler flags.
|
||||
# - `CARES_VERSION`: Version of c-ares.
|
||||
|
||||
set(CARES_PC_REQUIRES "libcares")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED CARES_INCLUDE_DIR AND
|
||||
NOT DEFINED CARES_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(CARES ${CARES_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(CARES_FOUND)
|
||||
set(Cares_FOUND TRUE)
|
||||
string(REPLACE ";" " " CARES_CFLAGS "${CARES_CFLAGS}")
|
||||
message(STATUS "Found Cares (via pkg-config): ${CARES_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
|
||||
else()
|
||||
find_path(CARES_INCLUDE_DIR NAMES "ares.h")
|
||||
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
|
||||
|
||||
unset(CARES_VERSION CACHE)
|
||||
if(CARES_INCLUDE_DIR AND EXISTS "${CARES_INCLUDE_DIR}/ares_version.h")
|
||||
set(_version_regex1 "#[\t ]*define[\t ]+ARES_VERSION_MAJOR[\t ]+([0-9]+).*")
|
||||
set(_version_regex2 "#[\t ]*define[\t ]+ARES_VERSION_MINOR[\t ]+([0-9]+).*")
|
||||
set(_version_regex3 "#[\t ]*define[\t ]+ARES_VERSION_PATCH[\t ]+([0-9]+).*")
|
||||
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str1 REGEX "${_version_regex1}")
|
||||
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str2 REGEX "${_version_regex2}")
|
||||
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str3 REGEX "${_version_regex3}")
|
||||
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
|
||||
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
|
||||
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
|
||||
set(CARES_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
|
||||
unset(_version_regex1)
|
||||
unset(_version_regex2)
|
||||
unset(_version_regex3)
|
||||
unset(_version_str1)
|
||||
unset(_version_str2)
|
||||
unset(_version_str3)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Cares
|
||||
REQUIRED_VARS
|
||||
CARES_INCLUDE_DIR
|
||||
CARES_LIBRARY
|
||||
VERSION_VAR
|
||||
CARES_VERSION
|
||||
)
|
||||
|
||||
if(CARES_FOUND)
|
||||
set(CARES_INCLUDE_DIRS ${CARES_INCLUDE_DIR})
|
||||
set(CARES_LIBRARIES ${CARES_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY)
|
||||
endif()
|
||||
|
||||
if(CARES_FOUND AND WIN32)
|
||||
list(APPEND CARES_LIBRARIES "iphlpapi") # for if_indextoname and others
|
||||
endif()
|
||||
@@ -1,365 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the GSS Kerberos library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment)
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `GSS_FOUND`: System has the Heimdal library.
|
||||
# - `GSS_FLAVOUR`: "GNU", "MIT" or "Heimdal" if anything found.
|
||||
# - `GSS_INCLUDE_DIRS`: The GSS include directories.
|
||||
# - `GSS_LIBRARIES`: The GSS library names.
|
||||
# - `GSS_LIBRARY_DIRS`: The GSS library directories.
|
||||
# - `GSS_PC_REQUIRES`: The GSS pkg-config packages.
|
||||
# - `GSS_CFLAGS`: Required compiler flags.
|
||||
# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest.
|
||||
# In case the library is found but no version info available it is set to "unknown"
|
||||
|
||||
set(_gnu_modname "gss")
|
||||
set(_mit_modname "mit-krb5-gssapi")
|
||||
set(_heimdal_modname "heimdal-gssapi")
|
||||
|
||||
include(CheckIncludeFile)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckTypeSize)
|
||||
|
||||
set(_gss_root_hints
|
||||
"${GSS_ROOT_DIR}"
|
||||
"$ENV{GSS_ROOT_DIR}"
|
||||
)
|
||||
|
||||
set(_gss_CFLAGS "")
|
||||
set(_gss_LIBRARY_DIRS "")
|
||||
|
||||
# Try to find library using system pkg-config if user did not specify root dir
|
||||
if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}")
|
||||
if(CURL_USE_PKGCONFIG)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_search_module(_gss ${_gnu_modname} ${_mit_modname} ${_heimdal_modname})
|
||||
list(APPEND _gss_root_hints "${_gss_PREFIX}")
|
||||
set(_gss_version "${_gss_VERSION}")
|
||||
endif()
|
||||
if(WIN32)
|
||||
list(APPEND _gss_root_hints "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos;InstallDir]")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional approach.
|
||||
find_file(_gss_configure_script
|
||||
NAMES
|
||||
"krb5-config"
|
||||
HINTS
|
||||
${_gss_root_hints}
|
||||
PATH_SUFFIXES
|
||||
"bin"
|
||||
NO_CMAKE_PATH
|
||||
NO_CMAKE_ENVIRONMENT_PATH
|
||||
)
|
||||
|
||||
# If not found in user-supplied directories, maybe system knows better
|
||||
find_file(_gss_configure_script
|
||||
NAMES
|
||||
"krb5-config"
|
||||
PATH_SUFFIXES
|
||||
"bin"
|
||||
)
|
||||
|
||||
if(_gss_configure_script)
|
||||
|
||||
set(_gss_INCLUDE_DIRS "")
|
||||
set(_gss_LIBRARIES "")
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_gss_configure_script} "--cflags" "gssapi"
|
||||
OUTPUT_VARIABLE _gss_cflags_raw
|
||||
RESULT_VARIABLE _gss_configure_failed
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
message(STATUS "FindGSS krb5-config --cflags: ${_gss_cflags_raw}")
|
||||
if(NOT _gss_configure_failed) # 0 means success
|
||||
# Should also work in an odd case when multiple directories are given.
|
||||
string(STRIP "${_gss_cflags_raw}" _gss_cflags_raw)
|
||||
string(REGEX REPLACE " +-(I)" ";-\\1" _gss_cflags_raw "${_gss_cflags_raw}")
|
||||
string(REGEX REPLACE " +-([^I][^ \\t;]*)" ";-\\1" _gss_cflags_raw "${_gss_cflags_raw}")
|
||||
|
||||
foreach(_flag IN LISTS _gss_cflags_raw)
|
||||
if(_flag MATCHES "^-I")
|
||||
string(REGEX REPLACE "^-I" "" _flag "${_flag}")
|
||||
list(APPEND _gss_INCLUDE_DIRS "${_flag}")
|
||||
else()
|
||||
list(APPEND _gss_CFLAGS "${_flag}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_gss_configure_script} "--libs" "gssapi"
|
||||
OUTPUT_VARIABLE _gss_lib_flags
|
||||
RESULT_VARIABLE _gss_configure_failed
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
message(STATUS "FindGSS krb5-config --libs: ${_gss_lib_flags}")
|
||||
|
||||
if(NOT _gss_configure_failed) # 0 means success
|
||||
# This script gives us libraries and link directories.
|
||||
string(STRIP "${_gss_lib_flags}" _gss_lib_flags)
|
||||
string(REGEX REPLACE " +-(L|l)" ";-\\1" _gss_lib_flags "${_gss_lib_flags}")
|
||||
string(REGEX REPLACE " +-([^Ll][^ \\t;]*)" ";-\\1" _gss_lib_flags "${_gss_lib_flags}")
|
||||
|
||||
foreach(_flag IN LISTS _gss_lib_flags)
|
||||
if(_flag MATCHES "^-l")
|
||||
string(REGEX REPLACE "^-l" "" _flag "${_flag}")
|
||||
list(APPEND _gss_LIBRARIES "${_flag}")
|
||||
elseif(_flag MATCHES "^-L")
|
||||
string(REGEX REPLACE "^-L" "" _flag "${_flag}")
|
||||
list(APPEND _gss_LIBRARY_DIRS "${_flag}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_gss_configure_script} "--version"
|
||||
OUTPUT_VARIABLE _gss_version
|
||||
RESULT_VARIABLE _gss_configure_failed
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Older versions may not have the "--version" parameter. In this case we just do not care.
|
||||
if(_gss_configure_failed)
|
||||
set(_gss_version 0)
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_gss_configure_script} "--vendor"
|
||||
OUTPUT_VARIABLE _gss_vendor
|
||||
RESULT_VARIABLE _gss_configure_failed
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Older versions may not have the "--vendor" parameter. In this case we just do not care.
|
||||
if(_gss_configure_failed)
|
||||
set(GSS_FLAVOUR "Heimdal") # most probably, should not really matter
|
||||
else()
|
||||
if(_gss_vendor MATCHES "H|heimdal")
|
||||
set(GSS_FLAVOUR "Heimdal")
|
||||
else()
|
||||
set(GSS_FLAVOUR "MIT")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else() # Either there is no config script or we are on a platform that does not provide one (Windows?)
|
||||
|
||||
find_path(_gss_INCLUDE_DIRS NAMES "gssapi/gssapi.h"
|
||||
HINTS
|
||||
${_gss_root_hints}
|
||||
PATH_SUFFIXES
|
||||
"include"
|
||||
"inc"
|
||||
)
|
||||
|
||||
if(_gss_INCLUDE_DIRS) # jay, we have found something
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${_gss_INCLUDE_DIRS}")
|
||||
check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers)
|
||||
|
||||
if(_gss_have_mit_headers)
|
||||
set(GSS_FLAVOUR "MIT")
|
||||
else()
|
||||
# Prevent compiling the header - just check if we can include it
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__")
|
||||
check_include_file("roken.h" _gss_have_roken_h)
|
||||
|
||||
check_include_file("heimdal/roken.h" _gss_have_heimdal_roken_h)
|
||||
if(_gss_have_roken_h OR _gss_have_heimdal_roken_h)
|
||||
set(GSS_FLAVOUR "Heimdal")
|
||||
endif()
|
||||
endif()
|
||||
cmake_pop_check_state()
|
||||
else()
|
||||
# I am not convinced if this is the right way but this is what autotools do at the moment
|
||||
find_path(_gss_INCLUDE_DIRS NAMES "gssapi.h"
|
||||
HINTS
|
||||
${_gss_root_hints}
|
||||
PATH_SUFFIXES
|
||||
"include"
|
||||
"inc"
|
||||
)
|
||||
|
||||
if(_gss_INCLUDE_DIRS)
|
||||
set(GSS_FLAVOUR "Heimdal")
|
||||
else()
|
||||
find_path(_gss_INCLUDE_DIRS NAMES "gss.h"
|
||||
HINTS
|
||||
${_gss_root_hints}
|
||||
PATH_SUFFIXES
|
||||
"include"
|
||||
)
|
||||
|
||||
if(_gss_INCLUDE_DIRS)
|
||||
set(GSS_FLAVOUR "GNU")
|
||||
set(GSS_PC_REQUIRES "gss")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If we have headers, check if we can link libraries
|
||||
if(GSS_FLAVOUR)
|
||||
set(_gss_libdir_suffixes "")
|
||||
set(_gss_libdir_hints ${_gss_root_hints})
|
||||
get_filename_component(_gss_calculated_potential_root "${_gss_INCLUDE_DIRS}" DIRECTORY)
|
||||
list(APPEND _gss_libdir_hints ${_gss_calculated_potential_root})
|
||||
|
||||
if(WIN32)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
list(APPEND _gss_libdir_suffixes "lib/AMD64")
|
||||
if(GSS_FLAVOUR STREQUAL "GNU")
|
||||
set(_gss_libname "gss")
|
||||
elseif(GSS_FLAVOUR STREQUAL "MIT")
|
||||
set(_gss_libname "gssapi64")
|
||||
else()
|
||||
set(_gss_libname "libgssapi")
|
||||
endif()
|
||||
else()
|
||||
list(APPEND _gss_libdir_suffixes "lib/i386")
|
||||
if(GSS_FLAVOUR STREQUAL "GNU")
|
||||
set(_gss_libname "gss")
|
||||
elseif(GSS_FLAVOUR STREQUAL "MIT")
|
||||
set(_gss_libname "gssapi32")
|
||||
else()
|
||||
set(_gss_libname "libgssapi")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
list(APPEND _gss_libdir_suffixes "lib;lib64") # those suffixes are not checked for HINTS
|
||||
if(GSS_FLAVOUR STREQUAL "GNU")
|
||||
set(_gss_libname "gss")
|
||||
elseif(GSS_FLAVOUR STREQUAL "MIT")
|
||||
set(_gss_libname "gssapi_krb5")
|
||||
else()
|
||||
set(_gss_libname "gssapi")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_library(_gss_LIBRARIES NAMES ${_gss_libname}
|
||||
HINTS
|
||||
${_gss_libdir_hints}
|
||||
PATH_SUFFIXES
|
||||
${_gss_libdir_suffixes}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
# _gss_MODULE_NAME set since CMake 3.16
|
||||
if(_gss_MODULE_NAME STREQUAL _gnu_modname OR _gss_${_gnu_modname}_VERSION)
|
||||
set(GSS_FLAVOUR "GNU")
|
||||
set(GSS_PC_REQUIRES "gss")
|
||||
if(NOT _gss_version) # for old CMake versions?
|
||||
set(_gss_version ${_gss_${_gnu_modname}_VERSION})
|
||||
endif()
|
||||
elseif(_gss_MODULE_NAME STREQUAL _mit_modname OR _gss_${_mit_modname}_VERSION)
|
||||
set(GSS_FLAVOUR "MIT")
|
||||
set(GSS_PC_REQUIRES "mit-krb5-gssapi")
|
||||
if(NOT _gss_version) # for old CMake versions?
|
||||
set(_gss_version ${_gss_${_mit_modname}_VERSION})
|
||||
endif()
|
||||
else()
|
||||
set(GSS_FLAVOUR "Heimdal")
|
||||
set(GSS_PC_REQUIRES "heimdal-gssapi")
|
||||
if(NOT _gss_version) # for old CMake versions?
|
||||
set(_gss_version ${_gss_${_heimdal_modname}_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "Found GSS/${GSS_FLAVOUR} (via pkg-config): ${_gss_INCLUDE_DIRS} (found version \"${_gss_version}\")")
|
||||
endif()
|
||||
|
||||
string(REPLACE ";" " " _gss_CFLAGS "${_gss_CFLAGS}")
|
||||
|
||||
set(GSS_INCLUDE_DIRS ${_gss_INCLUDE_DIRS})
|
||||
set(GSS_LIBRARIES ${_gss_LIBRARIES})
|
||||
set(GSS_LIBRARY_DIRS ${_gss_LIBRARY_DIRS})
|
||||
set(GSS_CFLAGS ${_gss_CFLAGS})
|
||||
set(GSS_VERSION ${_gss_version})
|
||||
|
||||
if(GSS_FLAVOUR)
|
||||
if(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "Heimdal")
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_heimdal_manifest_file "Heimdal.Application.amd64.manifest")
|
||||
else()
|
||||
set(_heimdal_manifest_file "Heimdal.Application.x86.manifest")
|
||||
endif()
|
||||
|
||||
if(EXISTS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}")
|
||||
file(STRINGS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}" _heimdal_version_str
|
||||
REGEX "^.*version=\"[0-9]\\.[^\"]+\".*$")
|
||||
|
||||
string(REGEX MATCH "[0-9]\\.[^\"]+" GSS_VERSION "${_heimdal_version_str}")
|
||||
endif()
|
||||
|
||||
if(NOT GSS_VERSION)
|
||||
set(GSS_VERSION "Heimdal Unknown")
|
||||
endif()
|
||||
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "MIT")
|
||||
get_filename_component(_mit_version "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME
|
||||
CACHE)
|
||||
if(WIN32 AND _mit_version)
|
||||
set(GSS_VERSION "${_mit_version}")
|
||||
else()
|
||||
set(GSS_VERSION "MIT Unknown")
|
||||
endif()
|
||||
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "GNU")
|
||||
if(GSS_INCLUDE_DIRS AND EXISTS "${GSS_INCLUDE_DIRS}/gss.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+GSS_VERSION[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${GSS_INCLUDE_DIRS}/gss.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(GSS_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GSS
|
||||
REQUIRED_VARS
|
||||
GSS_FLAVOUR
|
||||
GSS_LIBRARIES
|
||||
VERSION_VAR
|
||||
GSS_VERSION
|
||||
FAIL_MESSAGE
|
||||
"Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR"
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
_gss_CFLAGS
|
||||
_gss_FOUND
|
||||
_gss_INCLUDE_DIRS
|
||||
_gss_LIBRARIES
|
||||
_gss_LIBRARY_DIRS
|
||||
_gss_MODULE_NAME
|
||||
_gss_PREFIX
|
||||
_gss_version
|
||||
)
|
||||
@@ -1,107 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the ldap library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `LDAP_INCLUDE_DIR`: The ldap include directory.
|
||||
# - `LDAP_LIBRARY`: Path to `ldap` library.
|
||||
# - `LDAP_LBER_LIBRARY`: Path to `lber` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `LDAP_FOUND`: System has ldap.
|
||||
# - `LDAP_INCLUDE_DIRS`: The ldap include directories.
|
||||
# - `LDAP_LIBRARIES`: The ldap library names.
|
||||
# - `LDAP_LIBRARY_DIRS`: The ldap library directories.
|
||||
# - `LDAP_PC_REQUIRES`: The ldap pkg-config packages.
|
||||
# - `LDAP_CFLAGS`: Required compiler flags.
|
||||
# - `LDAP_VERSION`: Version of ldap.
|
||||
|
||||
set(LDAP_PC_REQUIRES "ldap" "lber")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED LDAP_INCLUDE_DIR AND
|
||||
NOT DEFINED LDAP_LIBRARY AND
|
||||
NOT DEFINED LDAP_LBER_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LDAP ${LDAP_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(LDAP_FOUND)
|
||||
set(LDAP_VERSION "${LDAP_ldap_VERSION}")
|
||||
string(REPLACE ";" " " LDAP_CFLAGS "${LDAP_CFLAGS}")
|
||||
message(STATUS "Found LDAP (via pkg-config): ${LDAP_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")")
|
||||
else()
|
||||
set(LDAP_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
|
||||
|
||||
# On Apple the SDK LDAP gets picked up from
|
||||
# 'MacOSX.sdk/System/Library/Frameworks/LDAP.framework/Headers', which contains
|
||||
# ldap.h and lber.h both being stubs to include <ldap.h> and <lber.h>.
|
||||
# This causes an infinite inclusion loop in compile. Also do this for libraries
|
||||
# to avoid picking up the 'ldap.framework' with a full path.
|
||||
set(_save_cmake_system_framework_path ${CMAKE_SYSTEM_FRAMEWORK_PATH})
|
||||
set(CMAKE_SYSTEM_FRAMEWORK_PATH "")
|
||||
find_path(LDAP_INCLUDE_DIR NAMES "ldap.h")
|
||||
find_library(LDAP_LIBRARY NAMES "ldap")
|
||||
find_library(LDAP_LBER_LIBRARY NAMES "lber")
|
||||
set(CMAKE_SYSTEM_FRAMEWORK_PATH ${_save_cmake_system_framework_path})
|
||||
|
||||
unset(LDAP_VERSION CACHE)
|
||||
if(LDAP_INCLUDE_DIR AND EXISTS "${LDAP_INCLUDE_DIR}/ldap_features.h")
|
||||
set(_version_regex1 "#[\t ]*define[\t ]+LDAP_VENDOR_VERSION_MAJOR[\t ]+([0-9]+).*")
|
||||
set(_version_regex2 "#[\t ]*define[\t ]+LDAP_VENDOR_VERSION_MINOR[\t ]+([0-9]+).*")
|
||||
set(_version_regex3 "#[\t ]*define[\t ]+LDAP_VENDOR_VERSION_PATCH[\t ]+([0-9]+).*")
|
||||
file(STRINGS "${LDAP_INCLUDE_DIR}/ldap_features.h" _version_str1 REGEX "${_version_regex1}")
|
||||
file(STRINGS "${LDAP_INCLUDE_DIR}/ldap_features.h" _version_str2 REGEX "${_version_regex2}")
|
||||
file(STRINGS "${LDAP_INCLUDE_DIR}/ldap_features.h" _version_str3 REGEX "${_version_regex3}")
|
||||
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
|
||||
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
|
||||
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
|
||||
set(LDAP_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
|
||||
unset(_version_regex1)
|
||||
unset(_version_regex2)
|
||||
unset(_version_regex3)
|
||||
unset(_version_str1)
|
||||
unset(_version_str2)
|
||||
unset(_version_str3)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LDAP
|
||||
REQUIRED_VARS
|
||||
LDAP_INCLUDE_DIR
|
||||
LDAP_LIBRARY
|
||||
LDAP_LBER_LIBRARY
|
||||
VERSION_VAR
|
||||
LDAP_VERSION
|
||||
)
|
||||
|
||||
if(LDAP_FOUND)
|
||||
set(LDAP_INCLUDE_DIRS ${LDAP_INCLUDE_DIR})
|
||||
set(LDAP_LIBRARIES ${LDAP_LIBRARY} ${LDAP_LBER_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LDAP_INCLUDE_DIR LDAP_LIBRARY LDAP_LBER_LIBRARY)
|
||||
endif()
|
||||
@@ -1,83 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the libgsasl library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory.
|
||||
# - `LIBGSASL_LIBRARY`: Path to `libgsasl` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `LIBGSASL_FOUND`: System has libgsasl.
|
||||
# - `LIBGSASL_INCLUDE_DIRS`: The libgsasl include directories.
|
||||
# - `LIBGSASL_LIBRARIES`: The libgsasl library names.
|
||||
# - `LIBGSASL_LIBRARY_DIRS`: The libgsasl library directories.
|
||||
# - `LIBGSASL_PC_REQUIRES`: The libgsasl pkg-config packages.
|
||||
# - `LIBGSASL_CFLAGS`: Required compiler flags.
|
||||
# - `LIBGSASL_VERSION`: Version of libgsasl.
|
||||
|
||||
set(LIBGSASL_PC_REQUIRES "libgsasl")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED LIBGSASL_INCLUDE_DIR AND
|
||||
NOT DEFINED LIBGSASL_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LIBGSASL ${LIBGSASL_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(LIBGSASL_FOUND)
|
||||
set(Libgsasl_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}")
|
||||
message(STATUS "Found Libgsasl (via pkg-config): ${LIBGSASL_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
|
||||
else()
|
||||
find_path(LIBGSASL_INCLUDE_DIR NAMES "gsasl.h")
|
||||
find_library(LIBGSASL_LIBRARY NAMES "gsasl" "libgsasl")
|
||||
|
||||
unset(LIBGSASL_VERSION CACHE)
|
||||
if(LIBGSASL_INCLUDE_DIR AND EXISTS "${LIBGSASL_INCLUDE_DIR}/gsasl-version.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+GSASL_VERSION[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${LIBGSASL_INCLUDE_DIR}/gsasl-version.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(LIBGSASL_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libgsasl
|
||||
REQUIRED_VARS
|
||||
LIBGSASL_INCLUDE_DIR
|
||||
LIBGSASL_LIBRARY
|
||||
VERSION_VAR
|
||||
LIBGSASL_VERSION
|
||||
)
|
||||
|
||||
if(LIBGSASL_FOUND)
|
||||
set(LIBGSASL_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR})
|
||||
set(LIBGSASL_LIBRARIES ${LIBGSASL_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBGSASL_INCLUDE_DIR LIBGSASL_LIBRARY)
|
||||
endif()
|
||||
@@ -1,83 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the libidn2 library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory.
|
||||
# - `LIBIDN2_LIBRARY`: Path to `libidn2` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `LIBIDN2_FOUND`: System has libidn2.
|
||||
# - `LIBIDN2_INCLUDE_DIRS`: The libidn2 include directories.
|
||||
# - `LIBIDN2_LIBRARIES`: The libidn2 library names.
|
||||
# - `LIBIDN2_LIBRARY_DIRS`: The libidn2 library directories.
|
||||
# - `LIBIDN2_PC_REQUIRES`: The libidn2 pkg-config packages.
|
||||
# - `LIBIDN2_CFLAGS`: Required compiler flags.
|
||||
# - `LIBIDN2_VERSION`: Version of libidn2.
|
||||
|
||||
set(LIBIDN2_PC_REQUIRES "libidn2")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED LIBIDN2_INCLUDE_DIR AND
|
||||
NOT DEFINED LIBIDN2_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LIBIDN2 ${LIBIDN2_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(LIBIDN2_FOUND)
|
||||
set(Libidn2_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}")
|
||||
message(STATUS "Found Libidn2 (via pkg-config): ${LIBIDN2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
|
||||
else()
|
||||
find_path(LIBIDN2_INCLUDE_DIR NAMES "idn2.h")
|
||||
find_library(LIBIDN2_LIBRARY NAMES "idn2" "libidn2")
|
||||
|
||||
unset(LIBIDN2_VERSION CACHE)
|
||||
if(LIBIDN2_INCLUDE_DIR AND EXISTS "${LIBIDN2_INCLUDE_DIR}/idn2.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+IDN2_VERSION[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${LIBIDN2_INCLUDE_DIR}/idn2.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(LIBIDN2_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libidn2
|
||||
REQUIRED_VARS
|
||||
LIBIDN2_INCLUDE_DIR
|
||||
LIBIDN2_LIBRARY
|
||||
VERSION_VAR
|
||||
LIBIDN2_VERSION
|
||||
)
|
||||
|
||||
if(LIBIDN2_FOUND)
|
||||
set(LIBIDN2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR})
|
||||
set(LIBIDN2_LIBRARIES ${LIBIDN2_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARY)
|
||||
endif()
|
||||
@@ -1,83 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the libpsl library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `LIBPSL_INCLUDE_DIR`: The libpsl include directory.
|
||||
# - `LIBPSL_LIBRARY`: Path to `libpsl` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `LIBPSL_FOUND`: System has libpsl.
|
||||
# - `LIBPSL_INCLUDE_DIRS`: The libpsl include directories.
|
||||
# - `LIBPSL_LIBRARIES`: The libpsl library names.
|
||||
# - `LIBPSL_LIBRARY_DIRS`: The libpsl library directories.
|
||||
# - `LIBPSL_PC_REQUIRES`: The libpsl pkg-config packages.
|
||||
# - `LIBPSL_CFLAGS`: Required compiler flags.
|
||||
# - `LIBPSL_VERSION`: Version of libpsl.
|
||||
|
||||
set(LIBPSL_PC_REQUIRES "libpsl")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED LIBPSL_INCLUDE_DIR AND
|
||||
NOT DEFINED LIBPSL_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LIBPSL ${LIBPSL_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(LIBPSL_FOUND AND LIBPSL_INCLUDE_DIRS)
|
||||
set(Libpsl_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBPSL_CFLAGS "${LIBPSL_CFLAGS}")
|
||||
message(STATUS "Found Libpsl (via pkg-config): ${LIBPSL_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")")
|
||||
else()
|
||||
find_path(LIBPSL_INCLUDE_DIR NAMES "libpsl.h")
|
||||
find_library(LIBPSL_LIBRARY NAMES "psl" "libpsl")
|
||||
|
||||
unset(LIBPSL_VERSION CACHE)
|
||||
if(LIBPSL_INCLUDE_DIR AND EXISTS "${LIBPSL_INCLUDE_DIR}/libpsl.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+PSL_VERSION[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${LIBPSL_INCLUDE_DIR}/libpsl.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(LIBPSL_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libpsl
|
||||
REQUIRED_VARS
|
||||
LIBPSL_INCLUDE_DIR
|
||||
LIBPSL_LIBRARY
|
||||
VERSION_VAR
|
||||
LIBPSL_VERSION
|
||||
)
|
||||
|
||||
if(LIBPSL_FOUND)
|
||||
set(LIBPSL_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR})
|
||||
set(LIBPSL_LIBRARIES ${LIBPSL_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY)
|
||||
endif()
|
||||
@@ -1,103 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the librtmp library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `LIBRTMP_INCLUDE_DIR`: The librtmp include directory.
|
||||
# - `LIBRTMP_LIBRARY`: Path to `librtmp` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `LIBRTMP_FOUND`: System has librtmp.
|
||||
# - `LIBRTMP_INCLUDE_DIRS`: The librtmp include directories.
|
||||
# - `LIBRTMP_LIBRARIES`: The librtmp library names.
|
||||
# - `LIBRTMP_LIBRARY_DIRS`: The librtmp library directories.
|
||||
# - `LIBRTMP_PC_REQUIRES`: The librtmp pkg-config packages.
|
||||
# - `LIBRTMP_CFLAGS`: Required compiler flags.
|
||||
# - `LIBRTMP_VERSION`: Version of librtmp.
|
||||
|
||||
set(LIBRTMP_PC_REQUIRES "librtmp")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED LIBRTMP_INCLUDE_DIR AND
|
||||
NOT DEFINED LIBRTMP_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LIBRTMP ${LIBRTMP_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(LIBRTMP_FOUND AND LIBRTMP_INCLUDE_DIRS)
|
||||
set(Librtmp_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBRTMP_CFLAGS "${LIBRTMP_CFLAGS}")
|
||||
message(STATUS "Found Librtmp (via pkg-config): ${LIBRTMP_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")")
|
||||
else()
|
||||
find_path(LIBRTMP_INCLUDE_DIR NAMES "librtmp/rtmp.h")
|
||||
find_library(LIBRTMP_LIBRARY NAMES "rtmp")
|
||||
|
||||
unset(LIBRTMP_VERSION CACHE)
|
||||
if(LIBRTMP_INCLUDE_DIR AND EXISTS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+RTMP_LIB_VERSION[\t ]+0x([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F]).*")
|
||||
file(STRINGS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str1 "${_version_str}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\2" _version_str2 "${_version_str}")
|
||||
if(CMAKE_VERSION VERSION_LESS 3.13)
|
||||
# No support for hex version numbers, just strip leading zeroes
|
||||
string(REGEX REPLACE "^0" "" _version_str1 "${_version_str1}")
|
||||
string(REGEX REPLACE "^0" "" _version_str2 "${_version_str2}")
|
||||
else()
|
||||
math(EXPR _version_str1 "0x${_version_str1}" OUTPUT_FORMAT DECIMAL)
|
||||
math(EXPR _version_str2 "0x${_version_str2}" OUTPUT_FORMAT DECIMAL)
|
||||
endif()
|
||||
set(LIBRTMP_VERSION "${_version_str1}.${_version_str2}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str1)
|
||||
unset(_version_str2)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Librtmp
|
||||
REQUIRED_VARS
|
||||
LIBRTMP_INCLUDE_DIR
|
||||
LIBRTMP_LIBRARY
|
||||
VERSION_VAR
|
||||
LIBRTMP_VERSION
|
||||
)
|
||||
|
||||
if(LIBRTMP_FOUND)
|
||||
set(LIBRTMP_INCLUDE_DIRS ${LIBRTMP_INCLUDE_DIR})
|
||||
set(LIBRTMP_LIBRARIES ${LIBRTMP_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBRTMP_INCLUDE_DIR LIBRTMP_LIBRARY)
|
||||
|
||||
# Necessary when linking a static librtmp
|
||||
find_package(OpenSSL)
|
||||
if(OPENSSL_FOUND)
|
||||
list(APPEND LIBRTMP_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LIBRTMP_FOUND AND WIN32)
|
||||
list(APPEND LIBRTMP_LIBRARIES "winmm")
|
||||
endif()
|
||||
@@ -1,97 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the libssh library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `LIBSSH_INCLUDE_DIR`: The libssh include directory.
|
||||
# - `LIBSSH_LIBRARY`: Path to libssh library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `LIBSSH_FOUND`: System has libssh.
|
||||
# - `LIBSSH_INCLUDE_DIRS`: The libssh include directories.
|
||||
# - `LIBSSH_LIBRARIES`: The libssh library names.
|
||||
# - `LIBSSH_LIBRARY_DIRS`: The libssh library directories.
|
||||
# - `LIBSSH_PC_REQUIRES`: The libssh pkg-config packages.
|
||||
# - `LIBSSH_CFLAGS`: Required compiler flags.
|
||||
# - `LIBSSH_VERSION`: Version of libssh.
|
||||
|
||||
set(LIBSSH_PC_REQUIRES "libssh")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED LIBSSH_INCLUDE_DIR AND
|
||||
NOT DEFINED LIBSSH_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LIBSSH ${LIBSSH_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(LIBSSH_FOUND)
|
||||
set(Libssh_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}")
|
||||
message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")")
|
||||
else()
|
||||
find_path(LIBSSH_INCLUDE_DIR NAMES "libssh/libssh.h")
|
||||
find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh")
|
||||
|
||||
unset(LIBSSH_VERSION CACHE)
|
||||
if(LIBSSH_INCLUDE_DIR AND EXISTS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h")
|
||||
set(_version_regex1 "#[\t ]*define[\t ]+LIBSSH_VERSION_MAJOR[\t ]+([0-9]+).*")
|
||||
set(_version_regex2 "#[\t ]*define[\t ]+LIBSSH_VERSION_MINOR[\t ]+([0-9]+).*")
|
||||
set(_version_regex3 "#[\t ]*define[\t ]+LIBSSH_VERSION_MICRO[\t ]+([0-9]+).*")
|
||||
file(STRINGS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h" _version_str1 REGEX "${_version_regex1}")
|
||||
file(STRINGS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h" _version_str2 REGEX "${_version_regex2}")
|
||||
file(STRINGS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h" _version_str3 REGEX "${_version_regex3}")
|
||||
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
|
||||
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
|
||||
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
|
||||
set(LIBSSH_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
|
||||
unset(_version_regex1)
|
||||
unset(_version_regex2)
|
||||
unset(_version_regex3)
|
||||
unset(_version_str1)
|
||||
unset(_version_str2)
|
||||
unset(_version_str3)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libssh
|
||||
REQUIRED_VARS
|
||||
LIBSSH_INCLUDE_DIR
|
||||
LIBSSH_LIBRARY
|
||||
VERSION_VAR
|
||||
LIBSSH_VERSION
|
||||
)
|
||||
|
||||
if(LIBSSH_FOUND)
|
||||
set(LIBSSH_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR})
|
||||
set(LIBSSH_LIBRARIES ${LIBSSH_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY)
|
||||
endif()
|
||||
|
||||
if(LIBSSH_FOUND AND WIN32)
|
||||
list(APPEND LIBSSH_LIBRARIES "iphlpapi") # for if_nametoindex
|
||||
endif()
|
||||
@@ -1,83 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the libssh2 library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory.
|
||||
# - `LIBSSH2_LIBRARY`: Path to `libssh2` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `LIBSSH2_FOUND`: System has libssh2.
|
||||
# - `LIBSSH2_INCLUDE_DIRS`: The libssh2 include directories.
|
||||
# - `LIBSSH2_LIBRARIES`: The libssh2 library names.
|
||||
# - `LIBSSH2_LIBRARY_DIRS`: The libssh2 library directories.
|
||||
# - `LIBSSH2_PC_REQUIRES`: The libssh2 pkg-config packages.
|
||||
# - `LIBSSH2_CFLAGS`: Required compiler flags.
|
||||
# - `LIBSSH2_VERSION`: Version of libssh2.
|
||||
|
||||
set(LIBSSH2_PC_REQUIRES "libssh2")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED LIBSSH2_INCLUDE_DIR AND
|
||||
NOT DEFINED LIBSSH2_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LIBSSH2 ${LIBSSH2_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(LIBSSH2_FOUND AND LIBSSH2_INCLUDE_DIRS)
|
||||
set(Libssh2_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBSSH2_CFLAGS "${LIBSSH2_CFLAGS}")
|
||||
message(STATUS "Found Libssh2 (via pkg-config): ${LIBSSH2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")")
|
||||
else()
|
||||
find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h")
|
||||
find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2")
|
||||
|
||||
unset(LIBSSH2_VERSION CACHE)
|
||||
if(LIBSSH2_INCLUDE_DIR AND EXISTS "${LIBSSH2_INCLUDE_DIR}/libssh2.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+LIBSSH2_VERSION[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${LIBSSH2_INCLUDE_DIR}/libssh2.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(LIBSSH2_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libssh2
|
||||
REQUIRED_VARS
|
||||
LIBSSH2_INCLUDE_DIR
|
||||
LIBSSH2_LIBRARY
|
||||
VERSION_VAR
|
||||
LIBSSH2_VERSION
|
||||
)
|
||||
|
||||
if(LIBSSH2_FOUND)
|
||||
set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
|
||||
set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
|
||||
endif()
|
||||
@@ -1,93 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the libuv library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `LIBUV_INCLUDE_DIR`: The libuv include directory.
|
||||
# - `LIBUV_LIBRARY`: Path to `libuv` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `LIBUV_FOUND`: System has libuv.
|
||||
# - `LIBUV_INCLUDE_DIRS`: The libuv include directories.
|
||||
# - `LIBUV_LIBRARIES`: The libuv library names.
|
||||
# - `LIBUV_LIBRARY_DIRS`: The libuv library directories.
|
||||
# - `LIBUV_PC_REQUIRES`: The libuv pkg-config packages.
|
||||
# - `LIBUV_CFLAGS`: Required compiler flags.
|
||||
# - `LIBUV_VERSION`: Version of libuv.
|
||||
|
||||
set(LIBUV_PC_REQUIRES "libuv")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED LIBUV_INCLUDE_DIR AND
|
||||
NOT DEFINED LIBUV_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LIBUV ${LIBUV_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(LIBUV_FOUND)
|
||||
set(Libuv_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}")
|
||||
message(STATUS "Found Libuv (via pkg-config): ${LIBUV_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
|
||||
else()
|
||||
find_path(LIBUV_INCLUDE_DIR NAMES "uv.h")
|
||||
find_library(LIBUV_LIBRARY NAMES "uv" "libuv")
|
||||
|
||||
unset(LIBUV_VERSION CACHE)
|
||||
if(LIBUV_INCLUDE_DIR AND EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h")
|
||||
set(_version_regex1 "#[\t ]*define[\t ]+UV_VERSION_MAJOR[\t ]+([0-9]+).*")
|
||||
set(_version_regex2 "#[\t ]*define[\t ]+UV_VERSION_MINOR[\t ]+([0-9]+).*")
|
||||
set(_version_regex3 "#[\t ]*define[\t ]+UV_VERSION_PATCH[\t ]+([0-9]+).*")
|
||||
file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" _version_str1 REGEX "${_version_regex1}")
|
||||
file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" _version_str2 REGEX "${_version_regex2}")
|
||||
file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" _version_str3 REGEX "${_version_regex3}")
|
||||
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
|
||||
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
|
||||
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
|
||||
set(LIBUV_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
|
||||
unset(_version_regex1)
|
||||
unset(_version_regex2)
|
||||
unset(_version_regex3)
|
||||
unset(_version_str1)
|
||||
unset(_version_str2)
|
||||
unset(_version_str3)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libuv
|
||||
REQUIRED_VARS
|
||||
LIBUV_INCLUDE_DIR
|
||||
LIBUV_LIBRARY
|
||||
VERSION_VAR
|
||||
LIBUV_VERSION
|
||||
)
|
||||
|
||||
if(LIBUV_FOUND)
|
||||
set(LIBUV_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR})
|
||||
set(LIBUV_LIBRARIES ${LIBUV_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY)
|
||||
endif()
|
||||
@@ -1,72 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the msh3 library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `MSH3_INCLUDE_DIR`: The msh3 include directory.
|
||||
# - `MSH3_LIBRARY`: Path to `msh3` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `MSH3_FOUND`: System has msh3.
|
||||
# - `MSH3_INCLUDE_DIRS`: The msh3 include directories.
|
||||
# - `MSH3_LIBRARIES`: The msh3 library names.
|
||||
# - `MSH3_LIBRARY_DIRS`: The msh3 library directories.
|
||||
# - `MSH3_PC_REQUIRES`: The msh3 pkg-config packages.
|
||||
# - `MSH3_CFLAGS`: Required compiler flags.
|
||||
# - `MSH3_VERSION`: Version of msh3.
|
||||
|
||||
set(MSH3_PC_REQUIRES "libmsh3")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED MSH3_INCLUDE_DIR AND
|
||||
NOT DEFINED MSH3_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(MSH3 ${MSH3_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(MSH3_FOUND)
|
||||
string(REPLACE ";" " " MSH3_CFLAGS "${MSH3_CFLAGS}")
|
||||
message(STATUS "Found MSH3 (via pkg-config): ${MSH3_INCLUDE_DIRS} (found version \"${MSH3_VERSION}\")")
|
||||
else()
|
||||
set(MSH3_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
|
||||
|
||||
find_path(MSH3_INCLUDE_DIR NAMES "msh3.h")
|
||||
find_library(MSH3_LIBRARY NAMES "msh3")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MSH3
|
||||
REQUIRED_VARS
|
||||
MSH3_INCLUDE_DIR
|
||||
MSH3_LIBRARY
|
||||
)
|
||||
|
||||
if(MSH3_FOUND)
|
||||
set(MSH3_INCLUDE_DIRS ${MSH3_INCLUDE_DIR})
|
||||
set(MSH3_LIBRARIES ${MSH3_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MSH3_INCLUDE_DIR MSH3_LIBRARY)
|
||||
endif()
|
||||
@@ -1,110 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the mbedTLS library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `MBEDTLS_INCLUDE_DIR`: The mbedTLS include directory.
|
||||
# - `MBEDTLS_LIBRARY`: Path to `mbedtls` library.
|
||||
# - `MBEDX509_LIBRARY`: Path to `mbedx509` library.
|
||||
# - `MBEDCRYPTO_LIBRARY`: Path to `mbedcrypto` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `MBEDTLS_FOUND`: System has mbedTLS.
|
||||
# - `MBEDTLS_INCLUDE_DIRS`: The mbedTLS include directories.
|
||||
# - `MBEDTLS_LIBRARIES`: The mbedTLS library names.
|
||||
# - `MBEDTLS_LIBRARY_DIRS`: The mbedTLS library directories.
|
||||
# - `MBEDTLS_PC_REQUIRES`: The mbedTLS pkg-config packages.
|
||||
# - `MBEDTLS_CFLAGS`: Required compiler flags.
|
||||
# - `MBEDTLS_VERSION`: Version of mbedTLS.
|
||||
|
||||
if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR)
|
||||
message(WARNING "MBEDTLS_INCLUDE_DIRS is deprecated, use MBEDTLS_INCLUDE_DIR instead.")
|
||||
set(MBEDTLS_INCLUDE_DIR "${MBEDTLS_INCLUDE_DIRS}")
|
||||
unset(MBEDTLS_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
set(MBEDTLS_PC_REQUIRES "mbedtls" "mbedx509" "mbedcrypto")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED MBEDTLS_INCLUDE_DIR AND
|
||||
NOT DEFINED MBEDTLS_LIBRARY AND
|
||||
NOT DEFINED MBEDX509_LIBRARY AND
|
||||
NOT DEFINED MBEDCRYPTO_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(MBEDTLS ${MBEDTLS_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(MBEDTLS_FOUND)
|
||||
set(MbedTLS_FOUND TRUE)
|
||||
set(MBEDTLS_VERSION "${MBEDTLS_mbedtls_VERSION}")
|
||||
string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}")
|
||||
message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")
|
||||
else()
|
||||
set(MBEDTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
|
||||
|
||||
find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h")
|
||||
find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls")
|
||||
find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509")
|
||||
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto")
|
||||
|
||||
unset(MBEDTLS_VERSION CACHE)
|
||||
if(MBEDTLS_INCLUDE_DIR)
|
||||
if(EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h") # 3.x
|
||||
set(_version_header "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h")
|
||||
elseif(EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h") # 2.x
|
||||
set(_version_header "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h")
|
||||
else()
|
||||
unset(_version_header)
|
||||
endif()
|
||||
if(_version_header)
|
||||
set(_version_regex "#[\t ]*define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"([0-9.]+)\"")
|
||||
file(STRINGS "${_version_header}" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(MBEDTLS_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
unset(_version_header)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MbedTLS
|
||||
REQUIRED_VARS
|
||||
MBEDTLS_INCLUDE_DIR
|
||||
MBEDTLS_LIBRARY
|
||||
MBEDX509_LIBRARY
|
||||
MBEDCRYPTO_LIBRARY
|
||||
VERSION_VAR
|
||||
MBEDTLS_VERSION
|
||||
)
|
||||
|
||||
if(MBEDTLS_FOUND)
|
||||
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
|
||||
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
|
||||
endif()
|
||||
@@ -1,82 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the nghttp2 library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `NGHTTP2_INCLUDE_DIR`: The nghttp2 include directory.
|
||||
# - `NGHTTP2_LIBRARY`: Path to `nghttp2` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `NGHTTP2_FOUND`: System has nghttp2.
|
||||
# - `NGHTTP2_INCLUDE_DIRS`: The nghttp2 include directories.
|
||||
# - `NGHTTP2_LIBRARIES`: The nghttp2 library names.
|
||||
# - `NGHTTP2_LIBRARY_DIRS`: The nghttp2 library directories.
|
||||
# - `NGHTTP2_PC_REQUIRES`: The nghttp2 pkg-config packages.
|
||||
# - `NGHTTP2_CFLAGS`: Required compiler flags.
|
||||
# - `NGHTTP2_VERSION`: Version of nghttp2.
|
||||
|
||||
set(NGHTTP2_PC_REQUIRES "libnghttp2")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED NGHTTP2_INCLUDE_DIR AND
|
||||
NOT DEFINED NGHTTP2_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(NGHTTP2 ${NGHTTP2_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(NGHTTP2_FOUND)
|
||||
string(REPLACE ";" " " NGHTTP2_CFLAGS "${NGHTTP2_CFLAGS}")
|
||||
message(STATUS "Found NGHTTP2 (via pkg-config): ${NGHTTP2_INCLUDE_DIRS} (found version \"${NGHTTP2_VERSION}\")")
|
||||
else()
|
||||
find_path(NGHTTP2_INCLUDE_DIR NAMES "nghttp2/nghttp2.h")
|
||||
find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static")
|
||||
|
||||
unset(NGHTTP2_VERSION CACHE)
|
||||
if(NGHTTP2_INCLUDE_DIR AND EXISTS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+NGHTTP2_VERSION[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(NGHTTP2_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(NGHTTP2
|
||||
REQUIRED_VARS
|
||||
NGHTTP2_INCLUDE_DIR
|
||||
NGHTTP2_LIBRARY
|
||||
VERSION_VAR
|
||||
NGHTTP2_VERSION
|
||||
)
|
||||
|
||||
if(NGHTTP2_FOUND)
|
||||
set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR})
|
||||
set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(NGHTTP2_INCLUDE_DIR NGHTTP2_LIBRARY)
|
||||
endif()
|
||||
@@ -1,82 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the nghttp3 library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `NGHTTP3_INCLUDE_DIR`: The nghttp3 include directory.
|
||||
# - `NGHTTP3_LIBRARY`: Path to `nghttp3` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `NGHTTP3_FOUND`: System has nghttp3.
|
||||
# - `NGHTTP3_INCLUDE_DIRS`: The nghttp3 include directories.
|
||||
# - `NGHTTP3_LIBRARIES`: The nghttp3 library names.
|
||||
# - `NGHTTP3_LIBRARY_DIRS`: The nghttp3 library directories.
|
||||
# - `NGHTTP3_PC_REQUIRES`: The nghttp3 pkg-config packages.
|
||||
# - `NGHTTP3_CFLAGS`: Required compiler flags.
|
||||
# - `NGHTTP3_VERSION`: Version of nghttp3.
|
||||
|
||||
set(NGHTTP3_PC_REQUIRES "libnghttp3")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED NGHTTP3_INCLUDE_DIR AND
|
||||
NOT DEFINED NGHTTP3_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(NGHTTP3 ${NGHTTP3_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(NGHTTP3_FOUND)
|
||||
string(REPLACE ";" " " NGHTTP3_CFLAGS "${NGHTTP3_CFLAGS}")
|
||||
message(STATUS "Found NGHTTP3 (via pkg-config): ${NGHTTP3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")")
|
||||
else()
|
||||
find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h")
|
||||
find_library(NGHTTP3_LIBRARY NAMES "nghttp3")
|
||||
|
||||
unset(NGHTTP3_VERSION CACHE)
|
||||
if(NGHTTP3_INCLUDE_DIR AND EXISTS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+NGHTTP3_VERSION[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(NGHTTP3_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(NGHTTP3
|
||||
REQUIRED_VARS
|
||||
NGHTTP3_INCLUDE_DIR
|
||||
NGHTTP3_LIBRARY
|
||||
VERSION_VAR
|
||||
NGHTTP3_VERSION
|
||||
)
|
||||
|
||||
if(NGHTTP3_FOUND)
|
||||
set(NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR})
|
||||
set(NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(NGHTTP3_INCLUDE_DIR NGHTTP3_LIBRARY)
|
||||
endif()
|
||||
@@ -1,128 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the ngtcp2 library
|
||||
#
|
||||
# This module accepts optional COMPONENTS to control the crypto library (these are
|
||||
# mutually exclusive):
|
||||
#
|
||||
# - quictls: Use `libngtcp2_crypto_quictls`. (choose this for LibreSSL)
|
||||
# - BoringSSL: Use `libngtcp2_crypto_boringssl`. (choose this for AWS-LC)
|
||||
# - wolfSSL: Use `libngtcp2_crypto_wolfssl`.
|
||||
# - GnuTLS: Use `libngtcp2_crypto_gnutls`.
|
||||
# - ossl: Use `libngtcp2_crypto_ossl`.
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory.
|
||||
# - `NGTCP2_LIBRARY`: Path to `ngtcp2` library.
|
||||
# - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Path to `ngtcp2_crypto_boringssl` library.
|
||||
# - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Path to `ngtcp2_crypto_gnutls` library.
|
||||
# - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Path to `ngtcp2_crypto_ossl` library.
|
||||
# - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Path to `ngtcp2_crypto_quictls` library.
|
||||
# - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Path to `ngtcp2_crypto_wolfssl` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `NGTCP2_FOUND`: System has ngtcp2.
|
||||
# - `NGTCP2_INCLUDE_DIRS`: The ngtcp2 include directories.
|
||||
# - `NGTCP2_LIBRARIES`: The ngtcp2 library names.
|
||||
# - `NGTCP2_LIBRARY_DIRS`: The ngtcp2 library directories.
|
||||
# - `NGTCP2_PC_REQUIRES`: The ngtcp2 pkg-config packages.
|
||||
# - `NGTCP2_CFLAGS`: Required compiler flags.
|
||||
# - `NGTCP2_VERSION`: Version of ngtcp2.
|
||||
|
||||
if(NGTCP2_FIND_COMPONENTS)
|
||||
set(_ngtcp2_crypto_backend "")
|
||||
foreach(_component IN LISTS NGTCP2_FIND_COMPONENTS)
|
||||
if(_component MATCHES "^(BoringSSL|GnuTLS|ossl|quictls|wolfSSL)")
|
||||
if(_ngtcp2_crypto_backend)
|
||||
message(FATAL_ERROR "NGTCP2: Only one crypto library can be selected")
|
||||
endif()
|
||||
set(_ngtcp2_crypto_backend ${_component})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(_ngtcp2_crypto_backend)
|
||||
string(TOLOWER "ngtcp2_crypto_${_ngtcp2_crypto_backend}" _crypto_library_lower)
|
||||
string(TOUPPER "ngtcp2_crypto_${_ngtcp2_crypto_backend}" _crypto_library_upper)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(NGTCP2_PC_REQUIRES "libngtcp2")
|
||||
if(_ngtcp2_crypto_backend)
|
||||
list(APPEND NGTCP2_PC_REQUIRES "lib${_crypto_library_lower}")
|
||||
endif()
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED NGTCP2_INCLUDE_DIR AND
|
||||
NOT DEFINED NGTCP2_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(NGTCP2 ${NGTCP2_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(NGTCP2_FOUND)
|
||||
set(NGTCP2_VERSION "${NGTCP2_libngtcp2_VERSION}")
|
||||
string(REPLACE ";" " " NGTCP2_CFLAGS "${NGTCP2_CFLAGS}")
|
||||
message(STATUS "Found NGTCP2 (via pkg-config): ${NGTCP2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")")
|
||||
else()
|
||||
find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h")
|
||||
find_library(NGTCP2_LIBRARY NAMES "ngtcp2")
|
||||
|
||||
unset(NGTCP2_VERSION CACHE)
|
||||
if(NGTCP2_INCLUDE_DIR AND EXISTS "${NGTCP2_INCLUDE_DIR}/ngtcp2/version.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+NGTCP2_VERSION[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${NGTCP2_INCLUDE_DIR}/ngtcp2/version.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(NGTCP2_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
|
||||
if(_ngtcp2_crypto_backend)
|
||||
get_filename_component(_ngtcp2_library_dir "${NGTCP2_LIBRARY}" DIRECTORY)
|
||||
find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower} HINTS ${_ngtcp2_library_dir})
|
||||
|
||||
if(${_crypto_library_upper}_LIBRARY)
|
||||
set(NGTCP2_${_ngtcp2_crypto_backend}_FOUND TRUE)
|
||||
set(NGTCP2_CRYPTO_LIBRARY ${${_crypto_library_upper}_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(NGTCP2
|
||||
REQUIRED_VARS
|
||||
NGTCP2_INCLUDE_DIR
|
||||
NGTCP2_LIBRARY
|
||||
VERSION_VAR
|
||||
NGTCP2_VERSION
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
|
||||
if(NGTCP2_FOUND)
|
||||
set(NGTCP2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR})
|
||||
set(NGTCP2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(NGTCP2_INCLUDE_DIR NGTCP2_LIBRARY NGTCP2_CRYPTO_LIBRARY)
|
||||
endif()
|
||||
@@ -1,88 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the nettle library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `NETTLE_INCLUDE_DIR`: The nettle include directory.
|
||||
# - `NETTLE_LIBRARY`: Path to `nettle` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `NETTLE_FOUND`: System has nettle.
|
||||
# - `NETTLE_INCLUDE_DIRS`: The nettle include directories.
|
||||
# - `NETTLE_LIBRARIES`: The nettle library names.
|
||||
# - `NETTLE_LIBRARY_DIRS`: The nettle library directories.
|
||||
# - `NETTLE_PC_REQUIRES`: The nettle pkg-config packages.
|
||||
# - `NETTLE_CFLAGS`: Required compiler flags.
|
||||
# - `NETTLE_VERSION`: Version of nettle.
|
||||
|
||||
set(NETTLE_PC_REQUIRES "nettle")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED NETTLE_INCLUDE_DIR AND
|
||||
NOT DEFINED NETTLE_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(NETTLE ${NETTLE_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(NETTLE_FOUND)
|
||||
set(Nettle_FOUND TRUE)
|
||||
string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}")
|
||||
message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
|
||||
else()
|
||||
find_path(NETTLE_INCLUDE_DIR NAMES "nettle/sha2.h")
|
||||
find_library(NETTLE_LIBRARY NAMES "nettle")
|
||||
|
||||
unset(NETTLE_VERSION CACHE)
|
||||
if(NETTLE_INCLUDE_DIR AND EXISTS "${NETTLE_INCLUDE_DIR}/nettle/version.h")
|
||||
set(_version_regex1 "#[\t ]*define[ \t]+NETTLE_VERSION_MAJOR[ \t]+([0-9]+).*")
|
||||
set(_version_regex2 "#[\t ]*define[ \t]+NETTLE_VERSION_MINOR[ \t]+([0-9]+).*")
|
||||
file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" _version_str1 REGEX "${_version_regex1}")
|
||||
file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" _version_str2 REGEX "${_version_regex2}")
|
||||
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
|
||||
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
|
||||
set(NETTLE_VERSION "${_version_str1}.${_version_str2}")
|
||||
unset(_version_regex1)
|
||||
unset(_version_regex2)
|
||||
unset(_version_str1)
|
||||
unset(_version_str2)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Nettle
|
||||
REQUIRED_VARS
|
||||
NETTLE_INCLUDE_DIR
|
||||
NETTLE_LIBRARY
|
||||
VERSION_VAR
|
||||
NETTLE_VERSION
|
||||
)
|
||||
|
||||
if(NETTLE_FOUND)
|
||||
set(NETTLE_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR})
|
||||
set(NETTLE_LIBRARIES ${NETTLE_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARY)
|
||||
endif()
|
||||
@@ -1,71 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the quiche library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `QUICHE_INCLUDE_DIR`: The quiche include directory.
|
||||
# - `QUICHE_LIBRARY`: Path to `quiche` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `QUICHE_FOUND`: System has quiche.
|
||||
# - `QUICHE_INCLUDE_DIRS`: The quiche include directories.
|
||||
# - `QUICHE_LIBRARIES`: The quiche library names.
|
||||
# - `QUICHE_LIBRARY_DIRS`: The quiche library directories.
|
||||
# - `QUICHE_PC_REQUIRES`: The quiche pkg-config packages.
|
||||
# - `QUICHE_CFLAGS`: Required compiler flags.
|
||||
# - `QUICHE_VERSION`: Version of quiche.
|
||||
|
||||
set(QUICHE_PC_REQUIRES "quiche")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED QUICHE_INCLUDE_DIR AND
|
||||
NOT DEFINED QUICHE_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(QUICHE ${QUICHE_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(QUICHE_FOUND)
|
||||
set(Quiche_FOUND TRUE)
|
||||
string(REPLACE ";" " " QUICHE_CFLAGS "${QUICHE_CFLAGS}")
|
||||
message(STATUS "Found Quiche (via pkg-config): ${QUICHE_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")")
|
||||
else()
|
||||
find_path(QUICHE_INCLUDE_DIR NAMES "quiche.h")
|
||||
find_library(QUICHE_LIBRARY NAMES "quiche")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Quiche
|
||||
REQUIRED_VARS
|
||||
QUICHE_INCLUDE_DIR
|
||||
QUICHE_LIBRARY
|
||||
)
|
||||
|
||||
if(QUICHE_FOUND)
|
||||
set(QUICHE_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR})
|
||||
set(QUICHE_LIBRARIES ${QUICHE_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(QUICHE_INCLUDE_DIR QUICHE_LIBRARY)
|
||||
endif()
|
||||
@@ -1,109 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the Rustls library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `RUSTLS_INCLUDE_DIR`: The Rustls include directory.
|
||||
# - `RUSTLS_LIBRARY`: Path to `rustls` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `RUSTLS_FOUND`: System has Rustls.
|
||||
# - `RUSTLS_INCLUDE_DIRS`: The Rustls include directories.
|
||||
# - `RUSTLS_LIBRARIES`: The Rustls library names.
|
||||
# - `RUSTLS_LIBRARY_DIRS`: The Rustls library directories.
|
||||
# - `RUSTLS_PC_REQUIRES`: The Rustls pkg-config packages.
|
||||
# - `RUSTLS_CFLAGS`: Required compiler flags.
|
||||
# - `RUSTLS_VERSION`: Version of Rustls.
|
||||
|
||||
set(RUSTLS_PC_REQUIRES "rustls")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED RUSTLS_INCLUDE_DIR AND
|
||||
NOT DEFINED RUSTLS_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(RUSTLS ${RUSTLS_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(RUSTLS_FOUND)
|
||||
set(Rustls_FOUND TRUE)
|
||||
string(REPLACE ";" " " RUSTLS_CFLAGS "${RUSTLS_CFLAGS}")
|
||||
message(STATUS "Found Rustls (via pkg-config): ${RUSTLS_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")")
|
||||
else()
|
||||
set(RUSTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
|
||||
|
||||
find_path(RUSTLS_INCLUDE_DIR NAMES "rustls.h")
|
||||
find_library(RUSTLS_LIBRARY NAMES "rustls")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Rustls
|
||||
REQUIRED_VARS
|
||||
RUSTLS_INCLUDE_DIR
|
||||
RUSTLS_LIBRARY
|
||||
)
|
||||
|
||||
if(RUSTLS_FOUND)
|
||||
set(RUSTLS_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR})
|
||||
set(RUSTLS_LIBRARIES ${RUSTLS_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(RUSTLS_INCLUDE_DIR RUSTLS_LIBRARY)
|
||||
endif()
|
||||
|
||||
if(RUSTLS_FOUND)
|
||||
if(APPLE)
|
||||
find_library(SECURITY_FRAMEWORK NAMES "Security")
|
||||
mark_as_advanced(SECURITY_FRAMEWORK)
|
||||
if(NOT SECURITY_FRAMEWORK)
|
||||
message(FATAL_ERROR "Security framework not found")
|
||||
endif()
|
||||
list(APPEND RUSTLS_LIBRARIES "-framework Security")
|
||||
|
||||
find_library(FOUNDATION_FRAMEWORK NAMES "Foundation")
|
||||
mark_as_advanced(FOUNDATION_FRAMEWORK)
|
||||
if(NOT FOUNDATION_FRAMEWORK)
|
||||
message(FATAL_ERROR "Foundation framework not found")
|
||||
endif()
|
||||
list(APPEND RUSTLS_LIBRARIES "-framework Foundation")
|
||||
elseif(NOT WIN32)
|
||||
find_library(PTHREAD_LIBRARY NAMES "pthread")
|
||||
if(PTHREAD_LIBRARY)
|
||||
list(APPEND RUSTLS_LIBRARIES ${PTHREAD_LIBRARY})
|
||||
endif()
|
||||
mark_as_advanced(PTHREAD_LIBRARY)
|
||||
|
||||
find_library(DL_LIBRARY NAMES "dl")
|
||||
if(DL_LIBRARY)
|
||||
list(APPEND RUSTLS_LIBRARIES ${DL_LIBRARY})
|
||||
endif()
|
||||
mark_as_advanced(DL_LIBRARY)
|
||||
|
||||
find_library(MATH_LIBRARY NAMES "m")
|
||||
if(MATH_LIBRARY)
|
||||
list(APPEND RUSTLS_LIBRARIES ${MATH_LIBRARY})
|
||||
endif()
|
||||
mark_as_advanced(MATH_LIBRARY)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,65 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the wolfSSH library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `WOLFSSH_INCLUDE_DIR`: The wolfSSH include directory.
|
||||
# - `WOLFSSH_LIBRARY`: Path to `wolfssh` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `WOLFSSH_FOUND`: System has wolfSSH.
|
||||
# - `WOLFSSH_INCLUDE_DIRS`: The wolfSSH include directories.
|
||||
# - `WOLFSSH_LIBRARIES`: The wolfSSH library names.
|
||||
# - `WOLFSSH_VERSION`: Version of wolfSSH.
|
||||
|
||||
find_path(WOLFSSH_INCLUDE_DIR NAMES "wolfssh/ssh.h")
|
||||
find_library(WOLFSSH_LIBRARY NAMES "wolfssh" "libwolfssh")
|
||||
|
||||
unset(WOLFSSH_VERSION CACHE)
|
||||
if(WOLFSSH_INCLUDE_DIR AND EXISTS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+LIBWOLFSSH_VERSION_STRING[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(WOLFSSH_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(WolfSSH
|
||||
REQUIRED_VARS
|
||||
WOLFSSH_INCLUDE_DIR
|
||||
WOLFSSH_LIBRARY
|
||||
VERSION_VAR
|
||||
WOLFSSH_VERSION
|
||||
)
|
||||
|
||||
if(WOLFSSH_FOUND)
|
||||
set(WOLFSSH_INCLUDE_DIRS ${WOLFSSH_INCLUDE_DIR})
|
||||
set(WOLFSSH_LIBRARIES ${WOLFSSH_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(WOLFSSH_INCLUDE_DIR WOLFSSH_LIBRARY)
|
||||
@@ -1,100 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the wolfSSL library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory.
|
||||
# - `WOLFSSL_LIBRARY`: Path to `wolfssl` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `WOLFSSL_FOUND`: System has wolfSSL.
|
||||
# - `WOLFSSL_INCLUDE_DIRS`: The wolfSSL include directories.
|
||||
# - `WOLFSSL_LIBRARIES`: The wolfSSL library names.
|
||||
# - `WOLFSSL_LIBRARY_DIRS`: The wolfSSL library directories.
|
||||
# - `WOLFSSL_PC_REQUIRES`: The wolfSSL pkg-config packages.
|
||||
# - `WOLFSSL_CFLAGS`: Required compiler flags.
|
||||
# - `WOLFSSL_VERSION`: Version of wolfSSL.
|
||||
|
||||
if(DEFINED WolfSSL_INCLUDE_DIR AND NOT DEFINED WOLFSSL_INCLUDE_DIR)
|
||||
message(WARNING "WolfSSL_INCLUDE_DIR is deprecated, use WOLFSSL_INCLUDE_DIR instead.")
|
||||
set(WOLFSSL_INCLUDE_DIR "${WolfSSL_INCLUDE_DIR}")
|
||||
endif()
|
||||
if(DEFINED WolfSSL_LIBRARY AND NOT DEFINED WOLFSSL_LIBRARY)
|
||||
message(WARNING "WolfSSL_LIBRARY is deprecated, use WOLFSSL_LIBRARY instead.")
|
||||
set(WOLFSSL_LIBRARY "${WolfSSL_LIBRARY}")
|
||||
endif()
|
||||
|
||||
set(WOLFSSL_PC_REQUIRES "wolfssl")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED WOLFSSL_INCLUDE_DIR AND
|
||||
NOT DEFINED WOLFSSL_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(WOLFSSL ${WOLFSSL_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(WOLFSSL_FOUND)
|
||||
set(WolfSSL_FOUND TRUE)
|
||||
string(REPLACE ";" " " WOLFSSL_CFLAGS "${WOLFSSL_CFLAGS}")
|
||||
message(STATUS "Found WolfSSL (via pkg-config): ${WOLFSSL_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")")
|
||||
else()
|
||||
find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h")
|
||||
find_library(WOLFSSL_LIBRARY NAMES "wolfssl")
|
||||
|
||||
unset(WOLFSSL_VERSION CACHE)
|
||||
if(WOLFSSL_INCLUDE_DIR AND EXISTS "${WOLFSSL_INCLUDE_DIR}/wolfssl/version.h")
|
||||
set(_version_regex "#[\t ]*define[\t ]+LIBWOLFSSL_VERSION_STRING[\t ]+\"([^\"]*)\"")
|
||||
file(STRINGS "${WOLFSSL_INCLUDE_DIR}/wolfssl/version.h" _version_str REGEX "${_version_regex}")
|
||||
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
|
||||
set(WOLFSSL_VERSION "${_version_str}")
|
||||
unset(_version_regex)
|
||||
unset(_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(WolfSSL
|
||||
REQUIRED_VARS
|
||||
WOLFSSL_INCLUDE_DIR
|
||||
WOLFSSL_LIBRARY
|
||||
VERSION_VAR
|
||||
WOLFSSL_VERSION
|
||||
)
|
||||
|
||||
if(WOLFSSL_FOUND)
|
||||
set(WOLFSSL_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR})
|
||||
set(WOLFSSL_LIBRARIES ${WOLFSSL_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY)
|
||||
endif()
|
||||
|
||||
if(WOLFSSL_FOUND AND NOT WIN32)
|
||||
find_library(MATH_LIBRARY NAMES "m")
|
||||
if(MATH_LIBRARY)
|
||||
list(APPEND WOLFSSL_LIBRARIES ${MATH_LIBRARY}) # for log and pow
|
||||
endif()
|
||||
mark_as_advanced(MATH_LIBRARY)
|
||||
endif()
|
||||
@@ -1,102 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Find the zstd library
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - `ZSTD_INCLUDE_DIR`: The zstd include directory.
|
||||
# - `ZSTD_LIBRARY`: Path to `zstd` library.
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# - `ZSTD_FOUND`: System has zstd.
|
||||
# - `ZSTD_INCLUDE_DIRS`: The zstd include directories.
|
||||
# - `ZSTD_LIBRARIES`: The zstd library names.
|
||||
# - `ZSTD_LIBRARY_DIRS`: The zstd library directories.
|
||||
# - `ZSTD_PC_REQUIRES`: The zstd pkg-config packages.
|
||||
# - `ZSTD_CFLAGS`: Required compiler flags.
|
||||
# - `ZSTD_VERSION`: Version of zstd.
|
||||
|
||||
if(DEFINED Zstd_INCLUDE_DIR AND NOT DEFINED ZSTD_INCLUDE_DIR)
|
||||
message(WARNING "Zstd_INCLUDE_DIR is deprecated, use ZSTD_INCLUDE_DIR instead.")
|
||||
set(ZSTD_INCLUDE_DIR "${Zstd_INCLUDE_DIR}")
|
||||
endif()
|
||||
if(DEFINED Zstd_LIBRARY AND NOT DEFINED ZSTD_LIBRARY)
|
||||
message(WARNING "Zstd_LIBRARY is deprecated, use ZSTD_LIBRARY instead.")
|
||||
set(ZSTD_LIBRARY "${Zstd_LIBRARY}")
|
||||
endif()
|
||||
|
||||
set(ZSTD_PC_REQUIRES "libzstd")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED ZSTD_INCLUDE_DIR AND
|
||||
NOT DEFINED ZSTD_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(ZSTD ${ZSTD_PC_REQUIRES})
|
||||
endif()
|
||||
|
||||
if(ZSTD_FOUND)
|
||||
set(Zstd_FOUND TRUE)
|
||||
string(REPLACE ";" " " ZSTD_CFLAGS "${ZSTD_CFLAGS}")
|
||||
message(STATUS "Found Zstd (via pkg-config): ${ZSTD_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")")
|
||||
else()
|
||||
find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h")
|
||||
find_library(ZSTD_LIBRARY NAMES "zstd")
|
||||
|
||||
unset(ZSTD_VERSION CACHE)
|
||||
if(ZSTD_INCLUDE_DIR AND EXISTS "${ZSTD_INCLUDE_DIR}/zstd.h")
|
||||
set(_version_regex1 "#[\t ]*define[ \t]+ZSTD_VERSION_MAJOR[ \t]+([0-9]+).*")
|
||||
set(_version_regex2 "#[\t ]*define[ \t]+ZSTD_VERSION_MINOR[ \t]+([0-9]+).*")
|
||||
set(_version_regex3 "#[\t ]*define[ \t]+ZSTD_VERSION_RELEASE[ \t]+([0-9]+).*")
|
||||
file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" _version_str1 REGEX "${_version_regex1}")
|
||||
file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" _version_str2 REGEX "${_version_regex2}")
|
||||
file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" _version_str3 REGEX "${_version_regex3}")
|
||||
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
|
||||
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
|
||||
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
|
||||
set(ZSTD_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
|
||||
unset(_version_regex1)
|
||||
unset(_version_regex2)
|
||||
unset(_version_regex3)
|
||||
unset(_version_str1)
|
||||
unset(_version_str2)
|
||||
unset(_version_str3)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Zstd
|
||||
REQUIRED_VARS
|
||||
ZSTD_INCLUDE_DIR
|
||||
ZSTD_LIBRARY
|
||||
VERSION_VAR
|
||||
ZSTD_VERSION
|
||||
)
|
||||
|
||||
if(ZSTD_FOUND)
|
||||
set(ZSTD_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR})
|
||||
set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)
|
||||
endif()
|
||||
@@ -1,174 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# File defines convenience macros for available feature testing
|
||||
|
||||
# Check if header file exists and add it to the list.
|
||||
# This macro is intended to be called multiple times with a sequence of
|
||||
# possibly dependent header files. Some headers depend on others to be
|
||||
# compiled correctly.
|
||||
macro(check_include_file_concat_curl _file _variable)
|
||||
check_include_files("${CURL_INCLUDES};${_file}" ${_variable})
|
||||
if(${_variable})
|
||||
list(APPEND CURL_INCLUDES ${_file})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
set(CURL_TEST_DEFINES "") # Initialize global variable
|
||||
|
||||
# For other curl specific tests, use this macro.
|
||||
# Return result in variable: CURL_TEST_OUTPUT
|
||||
macro(curl_internal_test _curl_test)
|
||||
if(NOT DEFINED "${_curl_test}")
|
||||
string(REPLACE ";" " " _cmake_required_definitions "${CMAKE_REQUIRED_DEFINITIONS}")
|
||||
set(_curl_test_add_libraries "")
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(_curl_test_add_libraries
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Performing Test ${_curl_test}")
|
||||
try_compile(${_curl_test}
|
||||
${PROJECT_BINARY_DIR}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c"
|
||||
CMAKE_FLAGS
|
||||
"-DCOMPILE_DEFINITIONS:STRING=-D${_curl_test} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS} ${_cmake_required_definitions}"
|
||||
"${_curl_test_add_libraries}"
|
||||
OUTPUT_VARIABLE CURL_TEST_OUTPUT)
|
||||
if(${_curl_test})
|
||||
set(${_curl_test} 1 CACHE INTERNAL "Curl test")
|
||||
message(STATUS "Performing Test ${_curl_test} - Success")
|
||||
else()
|
||||
set(${_curl_test} "" CACHE INTERNAL "Curl test")
|
||||
message(STATUS "Performing Test ${_curl_test} - Failed")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Option for dependencies that accepts an 'AUTO' value, which enables the dependency if detected.
|
||||
macro(curl_dependency_option _option_name _find_name _desc_name)
|
||||
set(${_option_name} "AUTO" CACHE STRING "Build curl with ${_desc_name} support (AUTO, ON or OFF)")
|
||||
set_property(CACHE ${_option_name} PROPERTY STRINGS "AUTO" "ON" "OFF")
|
||||
|
||||
if(${_option_name} STREQUAL "AUTO")
|
||||
find_package(${_find_name})
|
||||
elseif(${_option_name})
|
||||
find_package(${_find_name} REQUIRED)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Convert the passed paths to libpath linker options and add them to CMAKE_REQUIRED_*.
|
||||
macro(curl_required_libpaths _libpaths_arg)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.31)
|
||||
set(_libpaths "${_libpaths_arg}")
|
||||
foreach(_libpath IN LISTS _libpaths)
|
||||
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_LIBRARY_PATH_FLAG}${_libpath}")
|
||||
endforeach()
|
||||
else()
|
||||
list(APPEND CMAKE_REQUIRED_LINK_DIRECTORIES "${_libpaths_arg}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Pre-fill variables set by a check_type_size() call.
|
||||
macro(curl_prefill_type_size _type _size)
|
||||
set(HAVE_SIZEOF_${_type} TRUE)
|
||||
set(SIZEOF_${_type} ${_size})
|
||||
set(SIZEOF_${_type}_CODE "#define SIZEOF_${_type} ${_size}")
|
||||
endmacro()
|
||||
|
||||
# Internal: Recurse into target libraries and collect their include directories
|
||||
# and macro definitions.
|
||||
macro(curl_collect_target_options _target)
|
||||
get_target_property(_val ${_target} INTERFACE_INCLUDE_DIRECTORIES)
|
||||
if(_val)
|
||||
list(APPEND _includes ${_val})
|
||||
endif()
|
||||
get_target_property(_val ${_target} INCLUDE_DIRECTORIES)
|
||||
if(_val)
|
||||
list(APPEND _includes ${_val})
|
||||
endif()
|
||||
get_target_property(_val ${_target} COMPILE_DEFINITIONS)
|
||||
if(_val)
|
||||
list(APPEND _definitions ${_val})
|
||||
endif()
|
||||
get_target_property(_val ${_target} LINK_LIBRARIES)
|
||||
if(_val)
|
||||
foreach(_lib IN LISTS _val)
|
||||
if(TARGET "${_lib}")
|
||||
curl_collect_target_options(${_lib})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
unset(_val)
|
||||
endmacro()
|
||||
|
||||
# Create a clang-tidy target for test targets
|
||||
macro(curl_add_clang_tidy_test_target _target_clang_tidy _target)
|
||||
if(CURL_CLANG_TIDY)
|
||||
|
||||
set(_includes "")
|
||||
set(_definitions "")
|
||||
|
||||
# Collect header directories and macro definitions applying to the directory
|
||||
get_directory_property(_val INCLUDE_DIRECTORIES)
|
||||
if(_val)
|
||||
list(APPEND _includes ${_val})
|
||||
endif()
|
||||
get_directory_property(_val COMPILE_DEFINITIONS)
|
||||
if(_val)
|
||||
list(APPEND _definitions ${_val})
|
||||
endif()
|
||||
unset(_val)
|
||||
|
||||
# Collect header directories and macro definitions from lib dependencies
|
||||
curl_collect_target_options(${_target})
|
||||
|
||||
list(REMOVE_ITEM _includes "")
|
||||
string(REPLACE ";" ";-I" _includes ";${_includes}")
|
||||
list(REMOVE_DUPLICATES _includes)
|
||||
|
||||
list(REMOVE_ITEM _definitions "")
|
||||
string(REPLACE ";" ";-D" _definitions ";${_definitions}")
|
||||
list(REMOVE_DUPLICATES _definitions)
|
||||
list(SORT _definitions) # Sort like CMake does
|
||||
|
||||
# Assemble source list
|
||||
set(_sources "")
|
||||
foreach(_source IN ITEMS ${ARGN})
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_source}") # if not in source tree
|
||||
set(_source "${CMAKE_CURRENT_BINARY_DIR}/${_source}") # look in the build tree, for generated files, e.g. lib1521.c
|
||||
endif()
|
||||
list(APPEND _sources "${_source}")
|
||||
endforeach()
|
||||
|
||||
add_custom_target(${_target_clang_tidy} USES_TERMINAL
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
COMMAND ${CMAKE_C_CLANG_TIDY} ${_sources} -- ${_includes} ${_definitions}
|
||||
DEPENDS ${_sources})
|
||||
add_dependencies(tests-clang-tidy ${_target_clang_tidy})
|
||||
|
||||
unset(_includes)
|
||||
unset(_definitions)
|
||||
unset(_sources)
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,162 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckCSourceRuns)
|
||||
include(CheckTypeSize)
|
||||
|
||||
# #include header if condition is true
|
||||
macro(curl_add_header_include _check _header)
|
||||
if(${_check})
|
||||
set(_source_epilogue "${_source_epilogue}
|
||||
#include <${_header}>")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
set(_cmake_try_compile_target_type_save ${CMAKE_TRY_COMPILE_TARGET_TYPE})
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
|
||||
|
||||
if(NOT DEFINED HAVE_STRUCT_SOCKADDR_STORAGE)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES "")
|
||||
if(WIN32)
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32")
|
||||
else()
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
|
||||
endif()
|
||||
check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||
set(HAVE_STRUCT_SOCKADDR_STORAGE ${HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE})
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
set(_source_epilogue "#undef inline")
|
||||
curl_add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
#include <sys/socket.h>
|
||||
int main(void)
|
||||
{
|
||||
int flag = MSG_NOSIGNAL;
|
||||
(void)flag;
|
||||
return 0;
|
||||
}" HAVE_MSG_NOSIGNAL)
|
||||
endif()
|
||||
|
||||
set(_source_epilogue "#undef inline")
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
#ifdef _MSC_VER
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
int main(void)
|
||||
{
|
||||
struct timeval ts;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_usec = 0;
|
||||
(void)ts;
|
||||
return 0;
|
||||
}" HAVE_STRUCT_TIMEVAL)
|
||||
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_cmake_try_compile_target_type_save})
|
||||
unset(_cmake_try_compile_target_type_save)
|
||||
|
||||
# Detect HAVE_GETADDRINFO_THREADSAFE
|
||||
|
||||
if(WIN32)
|
||||
set(HAVE_GETADDRINFO_THREADSAFE ${HAVE_GETADDRINFO})
|
||||
elseif(NOT HAVE_GETADDRINFO)
|
||||
set(HAVE_GETADDRINFO_THREADSAFE FALSE)
|
||||
elseif(APPLE OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "HP-UX" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||
set(HAVE_GETADDRINFO_THREADSAFE TRUE)
|
||||
elseif(BSD OR CMAKE_SYSTEM_NAME MATCHES "BSD")
|
||||
set(HAVE_GETADDRINFO_THREADSAFE FALSE)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE)
|
||||
set(_source_epilogue "#undef inline
|
||||
#ifndef _WIN32
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#endif")
|
||||
curl_add_header_include(HAVE_NETDB_H "netdb.h")
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
int main(void)
|
||||
{
|
||||
#ifndef h_errno
|
||||
#error force compilation error
|
||||
#endif
|
||||
return 0;
|
||||
}" HAVE_H_ERRNO)
|
||||
|
||||
if(NOT HAVE_H_ERRNO)
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
int main(void)
|
||||
{
|
||||
h_errno = 2;
|
||||
return h_errno != 0 ? 1 : 0;
|
||||
}" HAVE_H_ERRNO_ASSIGNABLE)
|
||||
|
||||
if(NOT HAVE_H_ERRNO_ASSIGNABLE)
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
int main(void)
|
||||
{
|
||||
#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
|
||||
#elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700)
|
||||
#else
|
||||
#error force compilation error
|
||||
#endif
|
||||
return 0;
|
||||
}" HAVE_H_ERRNO_SBS_ISSUE_7)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(HAVE_H_ERRNO OR HAVE_H_ERRNO_ASSIGNABLE OR HAVE_H_ERRNO_SBS_ISSUE_7)
|
||||
set(HAVE_GETADDRINFO_THREADSAFE TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 AND NOT DEFINED HAVE_CLOCK_GETTIME_MONOTONIC_RAW)
|
||||
set(_source_epilogue "#undef inline")
|
||||
curl_add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
int main(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
|
||||
return 0;
|
||||
}" HAVE_CLOCK_GETTIME_MONOTONIC_RAW)
|
||||
endif()
|
||||
|
||||
unset(_source_epilogue)
|
||||
@@ -1,361 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
set(_picky "")
|
||||
set(_picky_nocheck "") # not to pass to feature checks
|
||||
|
||||
if(CURL_WERROR)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
|
||||
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
|
||||
else()
|
||||
if(MSVC)
|
||||
list(APPEND _picky_nocheck "-WX")
|
||||
else() # llvm/clang and gcc style options
|
||||
list(APPEND _picky_nocheck "-Werror")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
|
||||
NOT DOS AND # Watt-32 headers use the '#include_next' GCC extension
|
||||
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) OR
|
||||
CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
list(APPEND _picky_nocheck "-pedantic-errors")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE AND
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.3))
|
||||
list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.3
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
list(APPEND _picky "-Werror-implicit-function-declaration") # clang 1.0 gcc 2.95
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
list(APPEND _picky "-W4") # Use the highest warning level for Visual Studio.
|
||||
elseif(BORLAND)
|
||||
list(APPEND _picky "-w-") # Disable warnings on Borland to avoid changing 3rd party code.
|
||||
endif()
|
||||
|
||||
if(PICKY_COMPILER)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
|
||||
# https://clang.llvm.org/docs/DiagnosticsReference.html
|
||||
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
|
||||
# _picky_enable = Options we want to enable as-is.
|
||||
# _picky_detect = Options we want to test first and enable if available.
|
||||
|
||||
# Prefer the -Wextra alias with clang.
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(_picky_enable "-Wextra")
|
||||
else()
|
||||
set(_picky_enable "-W")
|
||||
endif()
|
||||
|
||||
list(APPEND _picky_enable
|
||||
-Wall -pedantic
|
||||
)
|
||||
|
||||
# ----------------------------------
|
||||
# Add new options here, if in doubt:
|
||||
# ----------------------------------
|
||||
set(_picky_detect
|
||||
)
|
||||
|
||||
# Assume these options always exist with both clang and gcc.
|
||||
# Require clang 3.0 / gcc 2.95 or later.
|
||||
list(APPEND _picky_enable
|
||||
-Wbad-function-cast # clang 2.7 gcc 2.95
|
||||
-Wconversion # clang 2.7 gcc 2.95
|
||||
-Wmissing-declarations # clang 1.0 gcc 2.7
|
||||
-Wmissing-prototypes # clang 1.0 gcc 1.0
|
||||
-Wnested-externs # clang 1.0 gcc 2.7
|
||||
-Wno-long-long # clang 1.0 gcc 2.95
|
||||
-Wno-multichar # clang 1.0 gcc 2.95
|
||||
-Wpointer-arith # clang 1.0 gcc 1.4
|
||||
-Wshadow # clang 1.0 gcc 2.95
|
||||
-Wsign-compare # clang 1.0 gcc 2.95
|
||||
-Wundef # clang 1.0 gcc 2.95
|
||||
-Wunused # clang 1.1 gcc 2.95
|
||||
-Wwrite-strings # clang 1.0 gcc 1.4
|
||||
)
|
||||
|
||||
# Always enable with clang, version dependent with gcc
|
||||
set(_picky_common_old
|
||||
-Waddress # clang 2.7 gcc 4.3
|
||||
-Wattributes # clang 2.7 gcc 4.1
|
||||
-Wcast-align # clang 1.0 gcc 4.2
|
||||
-Wcast-qual # clang 3.0 gcc 3.4.6
|
||||
-Wdeclaration-after-statement # clang 1.0 gcc 3.4
|
||||
-Wdiv-by-zero # clang 2.7 gcc 4.1
|
||||
-Wempty-body # clang 2.7 gcc 4.3
|
||||
-Wendif-labels # clang 1.0 gcc 3.3
|
||||
-Wfloat-equal # clang 1.0 gcc 2.96 (3.0)
|
||||
-Wformat-security # clang 2.7 gcc 4.1
|
||||
-Wignored-qualifiers # clang 2.8 gcc 4.3
|
||||
-Wmissing-field-initializers # clang 2.7 gcc 4.1
|
||||
-Wmissing-noreturn # clang 2.7 gcc 4.1
|
||||
-Wno-format-nonliteral # clang 1.0 gcc 2.96 (3.0)
|
||||
-Wno-sign-conversion # clang 2.9 gcc 4.3
|
||||
-Wno-system-headers # clang 1.0 gcc 3.0
|
||||
# -Wpadded # clang 2.9 gcc 4.1 # Not used: We cannot change public structs
|
||||
-Wold-style-definition # clang 2.7 gcc 3.4
|
||||
-Wredundant-decls # clang 2.7 gcc 4.1
|
||||
-Wstrict-prototypes # clang 1.0 gcc 3.3
|
||||
# -Wswitch-enum # clang 2.7 gcc 4.1 # Not used: It basically disallows default case
|
||||
-Wtype-limits # clang 2.7 gcc 4.3
|
||||
-Wunreachable-code # clang 2.7 gcc 4.1
|
||||
# -Wunused-macros # clang 2.7 gcc 4.1 # Not practical
|
||||
# -Wno-error=unused-macros # clang 2.7 gcc 4.1
|
||||
-Wunused-parameter # clang 2.7 gcc 4.1
|
||||
-Wvla # clang 2.8 gcc 4.3
|
||||
)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
list(APPEND _picky_enable
|
||||
${_picky_common_old}
|
||||
-Wshift-sign-overflow # clang 2.9
|
||||
-Wshorten-64-to-32 # clang 1.0
|
||||
-Wformat=2 # clang 3.0 gcc 4.8
|
||||
)
|
||||
if(NOT MSVC)
|
||||
list(APPEND _picky_enable
|
||||
-Wlanguage-extension-token # clang 3.0
|
||||
)
|
||||
endif()
|
||||
# Enable based on compiler version
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.3))
|
||||
list(APPEND _picky_enable
|
||||
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.3
|
||||
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.6 g++ 11.0
|
||||
-Wheader-guard # clang 3.4 appleclang 5.1
|
||||
-Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0
|
||||
-Wsometimes-uninitialized # clang 3.2 appleclang 4.6
|
||||
# -Wunreachable-code-break # clang 3.5 appleclang 6.0 # Not used: Silent in "unity" builds
|
||||
-Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
|
||||
)
|
||||
endif()
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.3))
|
||||
list(APPEND _picky_enable
|
||||
-Wcomma # clang 3.9 appleclang 8.3
|
||||
-Wmissing-variable-declarations # clang 3.2 appleclang 4.6
|
||||
)
|
||||
endif()
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.3))
|
||||
list(APPEND _picky_enable
|
||||
-Wassign-enum # clang 7.0 appleclang 10.3
|
||||
-Wextra-semi-stmt # clang 7.0 appleclang 10.3
|
||||
)
|
||||
endif()
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.4))
|
||||
list(APPEND _picky_enable
|
||||
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 12.4 # We do silencing for clang 10.0 and above only
|
||||
-Wxor-used-as-pow # clang 10.0 gcc 13.0
|
||||
)
|
||||
endif()
|
||||
else() # gcc
|
||||
# Enable based on compiler version
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3)
|
||||
list(APPEND _picky_enable
|
||||
${_picky_common_old}
|
||||
-Wclobbered # gcc 4.3
|
||||
-Wmissing-parameter-type # gcc 4.3
|
||||
-Wold-style-declaration # gcc 4.3
|
||||
-Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0
|
||||
-Wstrict-aliasing=3 # gcc 4.0
|
||||
-ftree-vrp # gcc 4.3 (required for -Warray-bounds, included in -Wall)
|
||||
)
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.5)
|
||||
list(APPEND _picky_enable
|
||||
-Wjump-misses-init # gcc 4.5
|
||||
)
|
||||
if(MINGW)
|
||||
list(APPEND _picky_enable
|
||||
-Wno-pedantic-ms-format # gcc 4.5 (MinGW-only)
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
|
||||
list(APPEND _picky_enable
|
||||
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.3
|
||||
-Wformat=2 # clang 3.0 gcc 4.8
|
||||
-Wtrampolines # gcc 4.6
|
||||
)
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
|
||||
list(APPEND _picky_enable
|
||||
-Warray-bounds=2 # clang 3.0 gcc 5.0 (clang default: -Warray-bounds)
|
||||
)
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
|
||||
list(APPEND _picky_enable
|
||||
-Wduplicated-cond # gcc 6.0
|
||||
-Wnull-dereference # clang 3.0 gcc 6.0 (clang default)
|
||||
-fdelete-null-pointer-checks
|
||||
-Wshift-negative-value # clang 3.7 gcc 6.0 (clang default)
|
||||
-Wshift-overflow=2 # clang 3.0 gcc 6.0 (clang default: -Wshift-overflow)
|
||||
-Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
|
||||
)
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)
|
||||
list(APPEND _picky_enable
|
||||
-Walloc-zero # gcc 7.0
|
||||
-Wduplicated-branches # gcc 7.0
|
||||
-Wformat-truncation=2 # gcc 7.0
|
||||
-Wimplicit-fallthrough # clang 4.0 gcc 7.0
|
||||
-Wrestrict # gcc 7.0
|
||||
)
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
|
||||
list(APPEND _picky_enable
|
||||
-Warith-conversion # gcc 10.0
|
||||
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.6 g++ 11.0
|
||||
)
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
|
||||
list(APPEND _picky_enable
|
||||
-Warray-compare # clang 20.0 gcc 12.0
|
||||
-Wenum-int-mismatch # gcc 13.0
|
||||
-Wxor-used-as-pow # clang 10.0 gcc 13.0
|
||||
)
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0)
|
||||
list(APPEND _picky_enable
|
||||
-Wleading-whitespace=spaces # gcc 15.0
|
||||
-Wtrailing-whitespace=any # gcc 15.0
|
||||
-Wunterminated-string-initialization # gcc 15.0
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
|
||||
set(_picky_skipped "")
|
||||
foreach(_ccopt IN LISTS _picky_enable)
|
||||
string(REGEX MATCH "-W([a-z0-9-]+)" _ccmatch "${_ccopt}")
|
||||
if(_ccmatch AND CMAKE_C_FLAGS MATCHES "-Wno-${CMAKE_MATCH_1}" AND NOT _ccopt STREQUAL "-Wall" AND NOT _ccopt MATCHES "^-Wno-")
|
||||
string(APPEND _picky_skipped " ${_ccopt}")
|
||||
else()
|
||||
list(APPEND _picky "${_ccopt}")
|
||||
endif()
|
||||
endforeach()
|
||||
if(_picky_skipped)
|
||||
message(STATUS "Picky compiler options skipped due to CMAKE_C_FLAGS override:${_picky_skipped}")
|
||||
endif()
|
||||
|
||||
foreach(_ccopt IN LISTS _picky_detect)
|
||||
# Use a unique variable name 1. for meaningful log output 2. to have a fresh, undefined variable for each detection
|
||||
string(MAKE_C_IDENTIFIER "OPT${_ccopt}" _optvarname)
|
||||
# GCC only warns about unknown -Wno- options if there are also other diagnostic messages,
|
||||
# so test for the positive form instead
|
||||
string(REPLACE "-Wno-" "-W" _ccopt_on "${_ccopt}")
|
||||
check_c_compiler_flag(${_ccopt_on} ${_optvarname})
|
||||
if(${_optvarname})
|
||||
list(APPEND _picky "${_ccopt}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
|
||||
# Avoid false positives
|
||||
list(APPEND _picky "-Wno-shadow")
|
||||
list(APPEND _picky "-Wno-unreachable-code")
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
|
||||
# GCC <4.6 do not support #pragma to suppress warnings locally. Disable them globally instead.
|
||||
list(APPEND _picky "-Wno-overlength-strings")
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.0 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
|
||||
list(APPEND _picky "-Wno-missing-field-initializers") # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
|
||||
list(APPEND _picky "-Wno-type-limits") # Avoid false positives
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.1 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5.5)
|
||||
list(APPEND _picky "-Wno-conversion") # Avoid false positives
|
||||
endif()
|
||||
endif()
|
||||
elseif(MSVC AND MSVC_VERSION LESS_EQUAL 1943) # Skip for untested/unreleased newer versions
|
||||
list(APPEND _picky "-Wall")
|
||||
list(APPEND _picky "-wd4061") # enumerator 'A' in switch of enum 'B' is not explicitly handled by a case label
|
||||
list(APPEND _picky "-wd4191") # 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)(void)'
|
||||
list(APPEND _picky "-wd4255") # no function prototype given: converting '()' to '(void)' (in winuser.h)
|
||||
list(APPEND _picky "-wd4464") # relative include path contains '..'
|
||||
list(APPEND _picky "-wd4548") # expression before comma has no effect; expected expression with side-effect (in FD_SET())
|
||||
list(APPEND _picky "-wd4574") # 'M' is defined to be '0': did you mean to use '#if M'? (in ws2tcpip.h)
|
||||
list(APPEND _picky "-wd4668") # 'M' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' (in winbase.h)
|
||||
list(APPEND _picky "-wd4710") # 'snprintf': function not inlined
|
||||
list(APPEND _picky "-wd4711") # function 'A' selected for automatic inline expansion
|
||||
# volatile access of '<expression>' is subject to /volatile:<iso|ms> setting;
|
||||
# consider using __iso_volatile_load/store intrinsic functions (ARM64)
|
||||
list(APPEND _picky "-wd4746")
|
||||
list(APPEND _picky "-wd4774") # 'snprintf': format string expected in argument 3 is not a string literal
|
||||
list(APPEND _picky "-wd4820") # 'A': 'N' bytes padding added after data member 'B'
|
||||
if(MSVC_VERSION GREATER_EQUAL 1900)
|
||||
list(APPEND _picky "-wd5045") # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# clang-cl
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND MSVC)
|
||||
list(APPEND _picky "-Wno-language-extension-token") # Allow __int64
|
||||
|
||||
foreach(_wlist IN ITEMS _picky_nocheck _picky)
|
||||
set(_picky_tmp "")
|
||||
foreach(_ccopt IN LISTS "${_wlist}")
|
||||
# Prefix -Wall, otherwise clang-cl interprets it as an MSVC option and translates it to -Weverything
|
||||
if(_ccopt MATCHES "^-W" AND NOT _ccopt STREQUAL "-Wall")
|
||||
list(APPEND _picky_tmp ${_ccopt})
|
||||
else()
|
||||
list(APPEND _picky_tmp "-clang:${_ccopt}")
|
||||
endif()
|
||||
endforeach()
|
||||
set("${_wlist}" ${_picky_tmp}) # cmake-lint: disable=C0103
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(_picky_nocheck OR _picky)
|
||||
set(_picky_tmp "${_picky_nocheck}" "${_picky}")
|
||||
string(REPLACE ";" " " _picky_tmp "${_picky_tmp}")
|
||||
string(STRIP "${_picky_tmp}" _picky_tmp)
|
||||
message(STATUS "Picky compiler options: ${_picky_tmp}")
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "${_picky_nocheck}" "${_picky}")
|
||||
|
||||
# Apply to all feature checks
|
||||
string(REPLACE ";" " " _picky_tmp "${_picky}")
|
||||
string(APPEND CMAKE_REQUIRED_FLAGS " ${_picky_tmp}")
|
||||
|
||||
unset(_picky)
|
||||
unset(_picky_tmp)
|
||||
endif()
|
||||
@@ -1,81 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# File containing various utilities
|
||||
|
||||
# Return number of arguments that evaluate to true
|
||||
function(curl_count_true _output_count_var)
|
||||
set(_list_len 0)
|
||||
foreach(_option_var IN LISTS ARGN)
|
||||
if(${_option_var})
|
||||
math(EXPR _list_len "${_list_len} + 1")
|
||||
endif()
|
||||
endforeach()
|
||||
set(${_output_count_var} ${_list_len} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Dump all defined variables with their values
|
||||
function(curl_dumpvars)
|
||||
message("::group::CMake Variable Dump")
|
||||
get_cmake_property(_vars VARIABLES)
|
||||
foreach(_var IN ITEMS ${_vars})
|
||||
get_property(_var_type CACHE ${_var} PROPERTY TYPE)
|
||||
get_property(_var_advanced CACHE ${_var} PROPERTY ADVANCED)
|
||||
if(_var_type)
|
||||
set(_var_type ":${_var_type}")
|
||||
endif()
|
||||
if(_var_advanced)
|
||||
set(_var_advanced " [adv]")
|
||||
endif()
|
||||
message("${_var}${_var_type}${_var_advanced} = '${${_var}}'")
|
||||
endforeach()
|
||||
message("::endgroup::")
|
||||
endfunction()
|
||||
|
||||
# Dump all target properties
|
||||
function(curl_dumptargetprops _target)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19 AND TARGET "${_target}")
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" "--help-property-list" OUTPUT_VARIABLE _cmake_property_list)
|
||||
string(REPLACE "\n" ";" _cmake_property_list "${_cmake_property_list}")
|
||||
list(REMOVE_DUPLICATES _cmake_property_list)
|
||||
list(REMOVE_ITEM _cmake_property_list "")
|
||||
foreach(_prop IN LISTS _cmake_property_list)
|
||||
if(_prop MATCHES "<CONFIG>")
|
||||
foreach(_config IN ITEMS "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO")
|
||||
string(REPLACE "<CONFIG>" "${_config}" _propconfig "${_prop}")
|
||||
get_property(_is_set TARGET "${_target}" PROPERTY "${_propconfig}" SET)
|
||||
if(_is_set)
|
||||
get_target_property(_val "${_target}" "${_propconfig}")
|
||||
message("${_target}.${_propconfig} = '${_val}'")
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
get_property(_is_set TARGET "${_target}" PROPERTY "${_prop}" SET)
|
||||
if(_is_set)
|
||||
get_target_property(_val "${_target}" "${_prop}")
|
||||
message("${_target}.${_prop} = '${_val}'")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,50 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
set(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
|
||||
endif()
|
||||
message(${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" _files)
|
||||
string(REGEX REPLACE "\n" ";" _files "${_files}")
|
||||
foreach(_file ${_files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${_file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${_file}" OR EXISTS "$ENV{DESTDIR}${_file}")
|
||||
execute_process(
|
||||
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${_file}"
|
||||
RESULT_VARIABLE rm_retval
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET
|
||||
)
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${_file}")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "File $ENV{DESTDIR}${_file} does not exist.")
|
||||
endif()
|
||||
endforeach()
|
||||
@@ -1,77 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
if("@USE_OPENSSL@")
|
||||
if("@OPENSSL_VERSION_MAJOR@")
|
||||
find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@")
|
||||
else()
|
||||
find_dependency(OpenSSL)
|
||||
endif()
|
||||
endif()
|
||||
if("@HAVE_LIBZ@")
|
||||
find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@")
|
||||
endif()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
|
||||
# Alias for either shared or static library
|
||||
if(NOT TARGET @PROJECT_NAME@::@LIB_NAME@)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.11 AND CMAKE_VERSION VERSION_LESS 3.18)
|
||||
set_target_properties(@PROJECT_NAME@::@LIB_SELECTED@ PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
endif()
|
||||
add_library(@PROJECT_NAME@::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@)
|
||||
endif()
|
||||
|
||||
# For compatibility with CMake's FindCURL.cmake
|
||||
set(CURL_VERSION_STRING "@CURLVERSION@")
|
||||
set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@)
|
||||
set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
|
||||
|
||||
set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@")
|
||||
set(CURL_SUPPORTED_FEATURES "@CURL_SUPPORTED_FEATURES_LIST@")
|
||||
|
||||
foreach(_item IN LISTS CURL_SUPPORTED_PROTOCOLS CURL_SUPPORTED_FEATURES)
|
||||
set(CURL_SUPPORTS_${_item} TRUE)
|
||||
endforeach()
|
||||
|
||||
set(_missing_req "")
|
||||
foreach(_item IN LISTS CURL_FIND_COMPONENTS)
|
||||
if(CURL_SUPPORTS_${_item})
|
||||
set(CURL_${_item}_FOUND TRUE)
|
||||
elseif(CURL_FIND_REQUIRED_${_item})
|
||||
list(APPEND _missing_req ${_item})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(_missing_req)
|
||||
string(REPLACE ";" " " _missing_req "${_missing_req}")
|
||||
if(CURL_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "CURL: missing required components: ${_missing_req}")
|
||||
endif()
|
||||
unset(_missing_req)
|
||||
endif()
|
||||
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
@@ -1,313 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
# Based on CI runs for Cygwin/MSYS2, Linux, macOS, FreeBSD, NetBSD, OpenBSD
|
||||
if(NOT UNIX)
|
||||
message(FATAL_ERROR "This file should be included on Unix platforms only")
|
||||
endif()
|
||||
|
||||
if(APPLE OR
|
||||
CYGWIN)
|
||||
set(HAVE_ACCEPT4 0)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
set(HAVE_ACCEPT4 1)
|
||||
endif()
|
||||
set(HAVE_ALARM 1)
|
||||
if(ANDROID)
|
||||
set(HAVE_ARC4RANDOM 1)
|
||||
else()
|
||||
set(HAVE_ARC4RANDOM 0)
|
||||
endif()
|
||||
set(HAVE_ARPA_INET_H 1)
|
||||
set(HAVE_ATOMIC 1)
|
||||
set(HAVE_BASENAME 1)
|
||||
set(HAVE_BOOL_T 1)
|
||||
if(NOT APPLE)
|
||||
set(HAVE_CLOCK_GETTIME_MONOTONIC 1)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(HAVE_CLOCK_GETTIME_MONOTONIC_RAW 1)
|
||||
else()
|
||||
set(HAVE_CLOCK_GETTIME_MONOTONIC_RAW 0)
|
||||
endif()
|
||||
endif()
|
||||
set(HAVE_CLOSESOCKET 0)
|
||||
set(HAVE_DECL_FSEEKO 1)
|
||||
set(HAVE_DIRENT_H 1)
|
||||
if(APPLE OR
|
||||
CYGWIN OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
set(HAVE_EVENTFD 0)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
||||
set(HAVE_EVENTFD 1)
|
||||
endif()
|
||||
set(HAVE_FCNTL 1)
|
||||
set(HAVE_FCNTL_H 1)
|
||||
set(HAVE_FCNTL_O_NONBLOCK 1)
|
||||
set(HAVE_FILE_OFFSET_BITS 1)
|
||||
set(HAVE_FNMATCH 1)
|
||||
set(HAVE_FREEADDRINFO 1)
|
||||
set(HAVE_FSEEKO 1)
|
||||
if(APPLE)
|
||||
set(HAVE_FSETXATTR 1)
|
||||
set(HAVE_FSETXATTR_5 0)
|
||||
set(HAVE_FSETXATTR_6 1)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
set(HAVE_FSETXATTR 0)
|
||||
set(HAVE_FSETXATTR_5 0)
|
||||
set(HAVE_FSETXATTR_6 0)
|
||||
elseif(CYGWIN OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
||||
set(HAVE_FSETXATTR 1)
|
||||
set(HAVE_FSETXATTR_5 1)
|
||||
set(HAVE_FSETXATTR_6 0)
|
||||
endif()
|
||||
set(HAVE_FTRUNCATE 1)
|
||||
set(HAVE_GETADDRINFO 1)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
set(HAVE_GETADDRINFO_THREADSAFE 0)
|
||||
elseif(CYGWIN OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
||||
set(HAVE_GETADDRINFO_THREADSAFE 1)
|
||||
endif()
|
||||
set(HAVE_GETEUID 1)
|
||||
if(APPLE OR
|
||||
CYGWIN OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
set(HAVE_GETHOSTBYNAME_R 0)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
set(HAVE_GETHOSTBYNAME_R 1)
|
||||
endif()
|
||||
set(HAVE_GETHOSTBYNAME_R_3 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_5 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(HAVE_GETHOSTBYNAME_R_6 1)
|
||||
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 1)
|
||||
else()
|
||||
set(HAVE_GETHOSTBYNAME_R_6 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
|
||||
endif()
|
||||
set(HAVE_GETHOSTNAME 1)
|
||||
if(NOT ANDROID OR ANDROID_PLATFORM_LEVEL GREATER_EQUAL 24)
|
||||
set(HAVE_GETIFADDRS 1)
|
||||
else()
|
||||
set(HAVE_GETIFADDRS 0)
|
||||
endif()
|
||||
if(APPLE OR
|
||||
CYGWIN OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
set(HAVE_GETPASS_R 0)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
||||
set(HAVE_GETPASS_R 1)
|
||||
endif()
|
||||
set(HAVE_GETPEERNAME 1)
|
||||
set(HAVE_GETPPID 1)
|
||||
set(HAVE_GETPWUID 1)
|
||||
set(HAVE_GETPWUID_R 1)
|
||||
set(HAVE_GETRLIMIT 1)
|
||||
set(HAVE_GETSOCKNAME 1)
|
||||
set(HAVE_GETTIMEOFDAY 1)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(HAVE_GLIBC_STRERROR_R 1)
|
||||
else()
|
||||
set(HAVE_GLIBC_STRERROR_R 0)
|
||||
endif()
|
||||
set(HAVE_GMTIME_R 1)
|
||||
set(HAVE_IFADDRS_H 1)
|
||||
set(HAVE_IF_NAMETOINDEX 1)
|
||||
set(HAVE_INET_NTOP 1)
|
||||
set(HAVE_INET_PTON 1)
|
||||
set(HAVE_IOCTLSOCKET 0)
|
||||
set(HAVE_IOCTLSOCKET_CAMEL 0)
|
||||
set(HAVE_IOCTLSOCKET_CAMEL_FIONBIO 0)
|
||||
set(HAVE_IOCTLSOCKET_FIONBIO 0)
|
||||
set(HAVE_IOCTL_FIONBIO 1)
|
||||
set(HAVE_IOCTL_SIOCGIFADDR 1)
|
||||
if(CYGWIN)
|
||||
set(HAVE_IO_H 1)
|
||||
else()
|
||||
set(HAVE_IO_H 0)
|
||||
endif()
|
||||
set(HAVE_LIBGEN_H 1)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(HAVE_LINUX_TCP_H 1)
|
||||
else()
|
||||
set(HAVE_LINUX_TCP_H 0)
|
||||
endif()
|
||||
set(HAVE_LOCALE_H 1)
|
||||
set(HAVE_LONGLONG 1)
|
||||
if(APPLE)
|
||||
set(HAVE_MACH_ABSOLUTE_TIME 1)
|
||||
endif()
|
||||
if(APPLE OR
|
||||
CYGWIN)
|
||||
set(HAVE_MEMRCHR 0)
|
||||
else()
|
||||
set(HAVE_MEMRCHR 1)
|
||||
endif()
|
||||
set(HAVE_MSG_NOSIGNAL 1)
|
||||
set(HAVE_NETDB_H 1)
|
||||
if(ANDROID)
|
||||
set(HAVE_NETINET_IN6_H 1)
|
||||
else()
|
||||
set(HAVE_NETINET_IN6_H 0)
|
||||
endif()
|
||||
set(HAVE_NETINET_IN_H 1)
|
||||
set(HAVE_NETINET_TCP_H 1)
|
||||
set(HAVE_NETINET_UDP_H 1)
|
||||
set(HAVE_NET_IF_H 1)
|
||||
set(HAVE_OPENDIR 1)
|
||||
set(HAVE_PIPE 1)
|
||||
if(APPLE OR
|
||||
CYGWIN)
|
||||
set(HAVE_PIPE2 0)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
set(HAVE_PIPE2 1)
|
||||
endif()
|
||||
set(HAVE_POLL 1)
|
||||
set(HAVE_POLL_H 1)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(HAVE_POSIX_STRERROR_R 0)
|
||||
else()
|
||||
set(HAVE_POSIX_STRERROR_R 1)
|
||||
endif()
|
||||
set(HAVE_PWD_H 1)
|
||||
set(HAVE_REALPATH 1)
|
||||
set(HAVE_RECV 1)
|
||||
set(HAVE_SA_FAMILY_T 1)
|
||||
set(HAVE_SCHED_YIELD 1)
|
||||
set(HAVE_SELECT 1)
|
||||
set(HAVE_SEND 1)
|
||||
if(APPLE OR
|
||||
CYGWIN)
|
||||
set(HAVE_SENDMMSG 0)
|
||||
else()
|
||||
set(HAVE_SENDMMSG 1)
|
||||
endif()
|
||||
set(HAVE_SENDMSG 1)
|
||||
set(HAVE_SETLOCALE 1)
|
||||
if(CYGWIN OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(HAVE_SETMODE 0)
|
||||
else()
|
||||
set(HAVE_SETMODE 1)
|
||||
endif()
|
||||
set(HAVE_SETRLIMIT 1)
|
||||
set(HAVE_SETSOCKOPT_SO_NONBLOCK 0)
|
||||
set(HAVE_SIGACTION 1)
|
||||
set(HAVE_SIGINTERRUPT 1)
|
||||
set(HAVE_SIGNAL 1)
|
||||
set(HAVE_SIGSETJMP 1)
|
||||
set(HAVE_SNPRINTF 1)
|
||||
set(HAVE_SOCKADDR_IN6_SIN6_ADDR 1)
|
||||
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
|
||||
set(HAVE_SOCKET 1)
|
||||
set(HAVE_SOCKETPAIR 1)
|
||||
set(HAVE_STDATOMIC_H 1)
|
||||
set(HAVE_STDBOOL_H 1)
|
||||
set(HAVE_STDDEF_H 1)
|
||||
set(HAVE_STDINT_H 1)
|
||||
set(HAVE_STRCASECMP 1)
|
||||
set(HAVE_STRCMPI 0)
|
||||
set(HAVE_STRDUP 1)
|
||||
set(HAVE_STRERROR_R 1)
|
||||
set(HAVE_STRICMP 0)
|
||||
set(HAVE_STRINGS_H 1)
|
||||
if(_CURL_OLD_LINUX)
|
||||
set(HAVE_STROPTS_H 1)
|
||||
else()
|
||||
set(HAVE_STROPTS_H 0) # glibc 2.30 or newer. https://sourceware.org/legacy-ml/libc-alpha/2019-08/msg00029.html
|
||||
endif()
|
||||
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
|
||||
set(HAVE_STRUCT_TIMEVAL 1)
|
||||
if(ANDROID OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
||||
set(HAVE_SUSECONDS_T 1)
|
||||
endif()
|
||||
if(APPLE OR
|
||||
CYGWIN OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
set(HAVE_SYS_EVENTFD_H 0)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
||||
set(HAVE_SYS_EVENTFD_H 1)
|
||||
endif()
|
||||
if(CYGWIN OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(HAVE_SYS_FILIO_H 0)
|
||||
else()
|
||||
set(HAVE_SYS_FILIO_H 1)
|
||||
endif()
|
||||
set(HAVE_SYS_IOCTL_H 1)
|
||||
set(HAVE_SYS_PARAM_H 1)
|
||||
set(HAVE_SYS_POLL_H 1)
|
||||
set(HAVE_SYS_RESOURCE_H 1)
|
||||
set(HAVE_SYS_SELECT_H 1)
|
||||
if(CYGWIN OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(HAVE_SYS_SOCKIO_H 0)
|
||||
else()
|
||||
set(HAVE_SYS_SOCKIO_H 1)
|
||||
endif()
|
||||
set(HAVE_SYS_TYPES_H 1)
|
||||
set(HAVE_SYS_UN_H 1)
|
||||
if(CYGWIN)
|
||||
set(HAVE_SYS_UTIME_H 1)
|
||||
else()
|
||||
set(HAVE_SYS_UTIME_H 0)
|
||||
endif()
|
||||
set(HAVE_TERMIOS_H 1)
|
||||
if(CYGWIN OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(HAVE_TERMIO_H 1)
|
||||
else()
|
||||
set(HAVE_TERMIO_H 0)
|
||||
endif()
|
||||
set(HAVE_TIME_T_UNSIGNED 0)
|
||||
set(HAVE_UNISTD_H 1)
|
||||
set(HAVE_UTIME 1)
|
||||
set(HAVE_UTIMES 1)
|
||||
set(HAVE_UTIME_H 1)
|
||||
set(HAVE_WRITABLE_ARGV 1)
|
||||
if(CYGWIN)
|
||||
set(HAVE__SETMODE 1)
|
||||
endif()
|
||||
set(STDC_HEADERS 1)
|
||||
set(USE_UNIX_SOCKETS 1)
|
||||
@@ -1,240 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "This file should be included on Windows platform only")
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
set(HAVE_BASENAME 1)
|
||||
set(HAVE_BOOL_T 1) # = HAVE_STDBOOL_H
|
||||
set(HAVE_DIRENT_H 1)
|
||||
set(HAVE_FTRUNCATE 1)
|
||||
set(HAVE_GETTIMEOFDAY 1)
|
||||
set(HAVE_LIBGEN_H 1)
|
||||
set(HAVE_OPENDIR 1)
|
||||
set(HAVE_SNPRINTF 1)
|
||||
set(HAVE_STDBOOL_H 1)
|
||||
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
|
||||
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
|
||||
set(HAVE_STRINGS_H 1) # wrapper to string.h
|
||||
set(HAVE_SYS_PARAM_H 1)
|
||||
set(HAVE_UNISTD_H 1)
|
||||
set(HAVE_UTIME_H 1) # wrapper to sys/utime.h
|
||||
else()
|
||||
set(HAVE_DIRENT_H 0)
|
||||
set(HAVE_FTRUNCATE 0)
|
||||
set(HAVE_GETTIMEOFDAY 0)
|
||||
set(HAVE_LIBGEN_H 0)
|
||||
set(HAVE_OPENDIR 0)
|
||||
set(HAVE_STRINGS_H 0)
|
||||
set(HAVE_SYS_PARAM_H 0)
|
||||
set(HAVE_UTIME_H 0)
|
||||
if(MSVC)
|
||||
set(HAVE_UNISTD_H 0)
|
||||
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1600)
|
||||
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
|
||||
else()
|
||||
set(HAVE_STDINT_H 0) # detected by CMake internally in check_type_size()
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1800)
|
||||
set(HAVE_STDBOOL_H 1)
|
||||
else()
|
||||
set(HAVE_STDBOOL_H 0)
|
||||
endif()
|
||||
set(HAVE_BOOL_T "${HAVE_STDBOOL_H}")
|
||||
if(MSVC_VERSION GREATER_EQUAL 1900)
|
||||
set(HAVE_SNPRINTF 1)
|
||||
else()
|
||||
set(HAVE_SNPRINTF 0)
|
||||
endif()
|
||||
set(HAVE_BASENAME 0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.9) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6))
|
||||
# MinGW or clang-cl
|
||||
set(HAVE_STDATOMIC_H 1)
|
||||
set(HAVE_ATOMIC 1)
|
||||
else()
|
||||
set(HAVE_STDATOMIC_H 0)
|
||||
set(HAVE_ATOMIC 0)
|
||||
endif()
|
||||
|
||||
set(HAVE_ACCEPT4 0)
|
||||
set(HAVE_ALARM 0)
|
||||
set(HAVE_ARC4RANDOM 0)
|
||||
set(HAVE_ARPA_INET_H 0)
|
||||
set(HAVE_CLOSESOCKET 1)
|
||||
set(HAVE_EVENTFD 0)
|
||||
set(HAVE_FCNTL 0)
|
||||
set(HAVE_FCNTL_H 1)
|
||||
set(HAVE_FCNTL_O_NONBLOCK 0)
|
||||
set(HAVE_FNMATCH 0)
|
||||
set(HAVE_FREEADDRINFO 1) # Available in Windows XP and newer
|
||||
set(HAVE_FSETXATTR 0)
|
||||
set(HAVE_GETADDRINFO 1) # Available in Windows XP and newer
|
||||
set(HAVE_GETEUID 0)
|
||||
set(HAVE_GETHOSTBYNAME_R 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_3 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_5 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_6 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
|
||||
set(HAVE_GETHOSTNAME 1)
|
||||
set(HAVE_GETIFADDRS 0)
|
||||
set(HAVE_GETPASS_R 0)
|
||||
set(HAVE_GETPEERNAME 1)
|
||||
set(HAVE_GETPPID 0)
|
||||
set(HAVE_GETPWUID 0)
|
||||
set(HAVE_GETPWUID_R 0)
|
||||
set(HAVE_GETRLIMIT 0)
|
||||
set(HAVE_GETSOCKNAME 1)
|
||||
set(HAVE_GLIBC_STRERROR_R 0)
|
||||
set(HAVE_GMTIME_R 0)
|
||||
set(HAVE_IFADDRS_H 0)
|
||||
set(HAVE_INET_NTOP 0)
|
||||
set(HAVE_INET_PTON 0)
|
||||
set(HAVE_IOCTLSOCKET 1)
|
||||
set(HAVE_IOCTLSOCKET_CAMEL 0)
|
||||
set(HAVE_IOCTLSOCKET_CAMEL_FIONBIO 0)
|
||||
set(HAVE_IOCTLSOCKET_FIONBIO 1)
|
||||
set(HAVE_IOCTL_FIONBIO 0)
|
||||
set(HAVE_IOCTL_SIOCGIFADDR 0)
|
||||
set(HAVE_IO_H 1)
|
||||
set(HAVE_LINUX_TCP_H 0)
|
||||
set(HAVE_LOCALE_H 1)
|
||||
set(HAVE_MEMRCHR 0)
|
||||
set(HAVE_MSG_NOSIGNAL 0)
|
||||
set(HAVE_NETDB_H 0)
|
||||
set(HAVE_NETINET_IN6_H 0)
|
||||
set(HAVE_NETINET_IN_H 0)
|
||||
set(HAVE_NETINET_TCP_H 0)
|
||||
set(HAVE_NETINET_UDP_H 0)
|
||||
set(HAVE_NET_IF_H 0)
|
||||
set(HAVE_PIPE 0)
|
||||
set(HAVE_PIPE2 0)
|
||||
set(HAVE_POLL 0)
|
||||
set(HAVE_POLL_H 0)
|
||||
set(HAVE_POSIX_STRERROR_R 0)
|
||||
set(HAVE_PWD_H 0)
|
||||
set(HAVE_RECV 1)
|
||||
set(HAVE_SELECT 1)
|
||||
set(HAVE_SEND 1)
|
||||
set(HAVE_SENDMMSG 0)
|
||||
set(HAVE_SENDMSG 0)
|
||||
set(HAVE_SETLOCALE 1)
|
||||
set(HAVE_SETMODE 1)
|
||||
set(HAVE_SETRLIMIT 0)
|
||||
set(HAVE_SETSOCKOPT_SO_NONBLOCK 0)
|
||||
set(HAVE_SIGACTION 0)
|
||||
set(HAVE_SIGINTERRUPT 0)
|
||||
set(HAVE_SIGNAL 1)
|
||||
set(HAVE_SIGSETJMP 0)
|
||||
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
|
||||
set(HAVE_SOCKET 1)
|
||||
set(HAVE_SOCKETPAIR 0)
|
||||
set(HAVE_STRDUP 1)
|
||||
set(HAVE_STRERROR_R 0)
|
||||
set(HAVE_STROPTS_H 0)
|
||||
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
|
||||
set(HAVE_STRUCT_TIMEVAL 1)
|
||||
set(HAVE_SYS_EVENTFD_H 0)
|
||||
set(HAVE_SYS_FILIO_H 0)
|
||||
set(HAVE_SYS_IOCTL_H 0)
|
||||
set(HAVE_SYS_POLL_H 0)
|
||||
set(HAVE_SYS_RESOURCE_H 0)
|
||||
set(HAVE_SYS_SELECT_H 0)
|
||||
set(HAVE_SYS_SOCKIO_H 0)
|
||||
set(HAVE_SYS_TYPES_H 1)
|
||||
set(HAVE_SYS_UN_H 0)
|
||||
set(HAVE_SYS_UTIME_H 1)
|
||||
set(HAVE_TERMIOS_H 0)
|
||||
set(HAVE_TERMIO_H 0)
|
||||
set(HAVE_TIME_T_UNSIGNED 0)
|
||||
set(HAVE_UTIME 1)
|
||||
set(HAVE_UTIMES 0)
|
||||
set(HAVE__SETMODE 1)
|
||||
set(STDC_HEADERS 1)
|
||||
|
||||
# Types and sizes
|
||||
|
||||
set(HAVE_SIZEOF_SA_FAMILY_T 0)
|
||||
set(HAVE_SIZEOF_SUSECONDS_T 0)
|
||||
|
||||
if(MINGW OR MSVC)
|
||||
curl_prefill_type_size("INT" 4)
|
||||
curl_prefill_type_size("LONG" 4)
|
||||
curl_prefill_type_size("LONG_LONG" 8)
|
||||
curl_prefill_type_size("__INT64" 8)
|
||||
curl_prefill_type_size("CURL_OFF_T" 8)
|
||||
# CURL_SOCKET_T, SIZE_T: 8 for _WIN64, 4 otherwise
|
||||
# TIME_T: 8 for _WIN64 or UCRT or MSVC and not Windows CE, 4 otherwise
|
||||
# Also 4 for non-UCRT 32-bit when _USE_32BIT_TIME_T is set.
|
||||
# mingw-w64 sets _USE_32BIT_TIME_T unless __MINGW_USE_VC2005_COMPAT is explicit defined.
|
||||
if(MSVC)
|
||||
set(HAVE_SIZEOF_SSIZE_T 0)
|
||||
set(HAVE_FILE_OFFSET_BITS 0)
|
||||
curl_prefill_type_size("OFF_T" 4)
|
||||
curl_prefill_type_size("ADDRESS_FAMILY" 2)
|
||||
else()
|
||||
# SSIZE_T: 8 for _WIN64, 4 otherwise
|
||||
if(MINGW64_VERSION)
|
||||
if(MINGW64_VERSION VERSION_GREATER_EQUAL 3.0)
|
||||
set(HAVE_FILE_OFFSET_BITS 1)
|
||||
curl_prefill_type_size("OFF_T" 8)
|
||||
endif()
|
||||
if(MINGW64_VERSION VERSION_GREATER_EQUAL 2.0)
|
||||
curl_prefill_type_size("ADDRESS_FAMILY" 2)
|
||||
else()
|
||||
set(HAVE_SIZEOF_ADDRESS_FAMILY 0)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Windows CE exceptions
|
||||
|
||||
if(WINCE)
|
||||
set(HAVE_FREEADDRINFO 0)
|
||||
set(HAVE_GETADDRINFO 0)
|
||||
set(HAVE_LOCALE_H 0)
|
||||
set(HAVE_SETLOCALE 0)
|
||||
set(HAVE_SETMODE 0)
|
||||
set(HAVE_SIGNAL 0)
|
||||
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 0)
|
||||
curl_prefill_type_size("CURL_SOCKET_T" 4)
|
||||
curl_prefill_type_size("TIME_T" 4)
|
||||
curl_prefill_type_size("SIZE_T" 4)
|
||||
if(MINGW32CE)
|
||||
set(HAVE_STRTOK_R 0)
|
||||
set(HAVE__SETMODE 0)
|
||||
set(HAVE_FILE_OFFSET_BITS 0)
|
||||
set(HAVE_SIZEOF_ADDRESS_FAMILY 0)
|
||||
curl_prefill_type_size("SSIZE_T" 4)
|
||||
curl_prefill_type_size("OFF_T" 4)
|
||||
endif()
|
||||
endif()
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1996 - 2025, Daniel Stenberg, <daniel@haxx.se>, and many
|
||||
contributors, see the THANKS file.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any purpose
|
||||
with or without fee is hereby granted, provided that the above copyright
|
||||
notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
||||
OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of a copyright holder shall not
|
||||
be used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization of the copyright holder.
|
||||
@@ -1,41 +0,0 @@
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
|
||||
# Self-contained build environment to match the release environment.
|
||||
#
|
||||
# Build and set the timestamp for the date corresponding to the release
|
||||
#
|
||||
# docker build --build-arg SOURCE_DATE_EPOCH=1711526400 --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t curl/curl .
|
||||
#
|
||||
# Then run commands from within the build environment, for example
|
||||
#
|
||||
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl autoreconf -fi
|
||||
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl ./configure --without-ssl --without-libpsl
|
||||
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl make
|
||||
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl ./scripts/maketgz 8.7.1
|
||||
#
|
||||
# or get into a shell in the build environment, for example
|
||||
#
|
||||
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl bash
|
||||
# $ autoreconf -fi
|
||||
# $ ./configure --without-ssl --without-libpsl
|
||||
# $ make
|
||||
# $ ./scripts/maketgz 8.7.1
|
||||
|
||||
# To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags
|
||||
FROM debian:bookworm-slim@sha256:6ac2c08566499cc2415926653cf2ed7c3aedac445675a013cc09469c9e118fdd
|
||||
|
||||
RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
|
||||
build-essential make autoconf automake libtool git perl zip zlib1g-dev gawk && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ARG UID=1000 GID=1000
|
||||
|
||||
RUN groupadd --gid $UID dev && \
|
||||
useradd --uid $UID --gid dev --shell /bin/bash --create-home dev
|
||||
|
||||
USER dev:dev
|
||||
|
||||
ARG SOURCE_DATE_EPOCH
|
||||
ENV SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:-1}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,222 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
CMAKE_DIST = \
|
||||
CMake/cmake_uninstall.cmake.in \
|
||||
CMake/CMakeConfigurableFile.in \
|
||||
CMake/curl-config.cmake.in \
|
||||
CMake/CurlSymbolHiding.cmake \
|
||||
CMake/CurlTests.c \
|
||||
CMake/FindBrotli.cmake \
|
||||
CMake/FindCares.cmake \
|
||||
CMake/FindGSS.cmake \
|
||||
CMake/FindLDAP.cmake \
|
||||
CMake/FindLibgsasl.cmake \
|
||||
CMake/FindLibidn2.cmake \
|
||||
CMake/FindLibpsl.cmake \
|
||||
CMake/FindLibrtmp.cmake \
|
||||
CMake/FindLibssh.cmake \
|
||||
CMake/FindLibssh2.cmake \
|
||||
CMake/FindLibuv.cmake \
|
||||
CMake/FindMSH3.cmake \
|
||||
CMake/FindMbedTLS.cmake \
|
||||
CMake/FindNGHTTP2.cmake \
|
||||
CMake/FindNGHTTP3.cmake \
|
||||
CMake/FindNGTCP2.cmake \
|
||||
CMake/FindNettle.cmake \
|
||||
CMake/FindQuiche.cmake \
|
||||
CMake/FindRustls.cmake \
|
||||
CMake/FindWolfSSH.cmake \
|
||||
CMake/FindWolfSSL.cmake \
|
||||
CMake/FindZstd.cmake \
|
||||
CMake/Macros.cmake \
|
||||
CMake/OtherTests.cmake \
|
||||
CMake/PickyWarnings.cmake \
|
||||
CMake/Utilities.cmake \
|
||||
CMake/unix-cache.cmake \
|
||||
CMake/win32-cache.cmake \
|
||||
CMakeLists.txt \
|
||||
tests/cmake/CMakeLists.txt \
|
||||
tests/cmake/test.c \
|
||||
tests/cmake/test.sh
|
||||
|
||||
VC_DIST = projects/README.md projects/generate.bat
|
||||
|
||||
WINBUILD_DIST = winbuild/README.md \
|
||||
winbuild/MakefileBuild.vc winbuild/Makefile.vc winbuild/makedebug.bat
|
||||
|
||||
PLAN9_DIST = plan9/include/mkfile \
|
||||
plan9/include/mkfile \
|
||||
plan9/mkfile.proto \
|
||||
plan9/mkfile \
|
||||
plan9/README \
|
||||
plan9/lib/mkfile.inc \
|
||||
plan9/lib/mkfile \
|
||||
plan9/src/mkfile.inc \
|
||||
plan9/src/mkfile
|
||||
|
||||
EXTRA_DIST = CHANGES.md COPYING RELEASE-NOTES Dockerfile \
|
||||
$(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) $(PLAN9_DIST)
|
||||
|
||||
DISTCLEANFILES = buildinfo.txt
|
||||
|
||||
bin_SCRIPTS = curl-config
|
||||
|
||||
SUBDIRS = lib docs src scripts
|
||||
DIST_SUBDIRS = $(SUBDIRS) tests packages include docs
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libcurl.pc
|
||||
|
||||
dist-hook:
|
||||
rm -rf $(top_builddir)/tests/log
|
||||
find $(distdir) -name "*.dist" -exec rm {} \;
|
||||
(distit=`find $(srcdir) -name "*.dist" | grep -v Makefile`; \
|
||||
for file in $$distit; do \
|
||||
strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
|
||||
cp -p $$file $(distdir)$$strip; \
|
||||
done)
|
||||
|
||||
check: test examples check-docs
|
||||
|
||||
if CROSSCOMPILING
|
||||
test-full: test
|
||||
test-nonflaky: test
|
||||
test-torture: test
|
||||
test-event: test
|
||||
test-am: test
|
||||
test-ci: test
|
||||
pytest: test
|
||||
pytest-ci: test
|
||||
|
||||
test:
|
||||
@echo "NOTICE: we can't run the tests when cross-compiling!"
|
||||
|
||||
else
|
||||
|
||||
test:
|
||||
@(cd tests; $(MAKE) all quiet-test)
|
||||
|
||||
test-full:
|
||||
@(cd tests; $(MAKE) all full-test)
|
||||
|
||||
test-nonflaky:
|
||||
@(cd tests; $(MAKE) all nonflaky-test)
|
||||
|
||||
test-torture:
|
||||
@(cd tests; $(MAKE) all torture-test)
|
||||
|
||||
test-event:
|
||||
@(cd tests; $(MAKE) all event-test)
|
||||
|
||||
test-am:
|
||||
@(cd tests; $(MAKE) all am-test)
|
||||
|
||||
test-ci:
|
||||
@(cd tests; $(MAKE) all ci-test)
|
||||
|
||||
pytest:
|
||||
@(cd tests; $(MAKE) all default-pytest)
|
||||
|
||||
pytest-ci:
|
||||
@(cd tests; $(MAKE) all ci-pytest)
|
||||
|
||||
endif
|
||||
|
||||
examples:
|
||||
@(cd docs/examples; $(MAKE) check)
|
||||
|
||||
check-docs:
|
||||
@(cd docs/libcurl; $(MAKE) check)
|
||||
|
||||
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
||||
# must contain the following line:
|
||||
# %_topdir /home/loic/local/rpm
|
||||
# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
|
||||
#
|
||||
# cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS
|
||||
#
|
||||
# If additional configure flags are needed to build the package, add the
|
||||
# following in ~/.rpmmacros
|
||||
# %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS}
|
||||
# and run make rpm in the following way:
|
||||
# AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm
|
||||
#
|
||||
|
||||
rpms:
|
||||
$(MAKE) RPMDIST=curl rpm
|
||||
$(MAKE) RPMDIST=curl-ssl rpm
|
||||
|
||||
rpm:
|
||||
RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
|
||||
cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \
|
||||
cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
|
||||
rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \
|
||||
mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \
|
||||
mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
|
||||
|
||||
# We extend the standard install with a custom hook:
|
||||
if BUILD_DOCS
|
||||
install-data-hook:
|
||||
(cd include && $(MAKE) install)
|
||||
(cd docs && $(MAKE) install)
|
||||
(cd docs/libcurl && $(MAKE) install)
|
||||
else
|
||||
install-data-hook:
|
||||
(cd include && $(MAKE) install)
|
||||
(cd docs && $(MAKE) install)
|
||||
endif
|
||||
|
||||
# We extend the standard uninstall with a custom hook:
|
||||
uninstall-hook:
|
||||
(cd include && $(MAKE) uninstall)
|
||||
(cd docs && $(MAKE) uninstall)
|
||||
(cd docs/libcurl && $(MAKE) uninstall)
|
||||
|
||||
ca-bundle: $(srcdir)/scripts/mk-ca-bundle.pl
|
||||
@echo "generating a fresh ca-bundle.crt"
|
||||
@perl $(srcdir)/scripts/mk-ca-bundle.pl -b -l -u lib/ca-bundle.crt
|
||||
|
||||
ca-firefox: $(srcdir)/scripts/firefox-db2pem.sh
|
||||
@echo "generating a fresh ca-bundle.crt"
|
||||
$(srcdir)/scripts/firefox-db2pem.sh lib/ca-bundle.crt
|
||||
|
||||
checksrc:
|
||||
(cd lib && $(MAKE) checksrc)
|
||||
(cd src && $(MAKE) checksrc)
|
||||
(cd tests && $(MAKE) checksrc)
|
||||
(cd include/curl && $(MAKE) checksrc)
|
||||
(cd docs/examples && $(MAKE) checksrc)
|
||||
(cd packages && $(MAKE) checksrc)
|
||||
|
||||
tidy:
|
||||
(cd src && $(MAKE) tidy)
|
||||
(cd lib && $(MAKE) tidy)
|
||||
|
||||
clean-local:
|
||||
(cd tests && $(MAKE) clean)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,55 +0,0 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
README
|
||||
|
||||
Curl is a command line tool for transferring data specified with URL
|
||||
syntax. Find out how to use curl by reading the curl.1 man page or the
|
||||
MANUAL document. Find out how to install Curl by reading the INSTALL
|
||||
document.
|
||||
|
||||
libcurl is the library curl is using to do its job. It is readily
|
||||
available to be used by your software. Read the libcurl.3 man page to
|
||||
learn how.
|
||||
|
||||
You find answers to the most frequent questions we get in the FAQ document.
|
||||
|
||||
Study the COPYING file for distribution terms.
|
||||
|
||||
Those documents and more can be found in the docs/ directory.
|
||||
|
||||
CONTACT
|
||||
|
||||
If you have problems, questions, ideas or suggestions, please contact us
|
||||
by posting to a suitable mailing list. See https://curl.se/mail/
|
||||
|
||||
All contributors to the project are listed in the THANKS document.
|
||||
|
||||
WEBSITE
|
||||
|
||||
Visit the curl website for the latest news and downloads:
|
||||
|
||||
https://curl.se/
|
||||
|
||||
GIT
|
||||
|
||||
To download the latest source code off the GIT server, do this:
|
||||
|
||||
git clone https://github.com/curl/curl.git
|
||||
|
||||
(you will get a directory named curl created, filled with the source code)
|
||||
|
||||
SECURITY PROBLEMS
|
||||
|
||||
Report suspected security problems via our HackerOne page and not in public.
|
||||
|
||||
https://hackerone.com/curl
|
||||
|
||||
NOTICE
|
||||
|
||||
Curl contains pieces of source code that is Copyright (c) 1998, 1999
|
||||
Kungliga Tekniska Högskolan. This notice is included here to comply with the
|
||||
distribution terms.
|
||||
@@ -1,510 +0,0 @@
|
||||
curl and libcurl 8.15.0
|
||||
|
||||
Public curl releases: 269
|
||||
Command line options: 269
|
||||
curl_easy_setopt() options: 308
|
||||
Public functions in libcurl: 96
|
||||
Contributors: 3460
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o TLS: remove support for Secure Transport and BearSSL [19]
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o altsvc: accept 'clear' without semicolon as well [190]
|
||||
o asyn-ares: remove redundant NULL check [152]
|
||||
o asyn-thrdd: free the previous name before strdup'ing the new [84]
|
||||
o autotools: detect and link `brotlicommon` library for brotli [130]
|
||||
o autotools: drop `$top_builddir/src` from src header path [23]
|
||||
o autotools: drop headers from src mk-unity rules (fixup) [136]
|
||||
o autotools: drop no longer necessary `--srcdir` unity options [66]
|
||||
o autotools: drop redundant `Makefile.inc` from `EXTRA_DIST` in src [127]
|
||||
o autotools: simplify configuration in tests, examples [47]
|
||||
o bufq: change read/write signatures [120]
|
||||
o bufq: remove the unused Curl_bufq_unwrite function [143]
|
||||
o build: assume `sys/socket.h`, `sys/time.h` on non-Windows (as in `curl/curl.h`) [21]
|
||||
o build: drop `HAVE_SYS_SOCKET_H` and `HAVE_SYS_TIME_H` macros [69]
|
||||
o build: drop explicit curlx from hdr paths, refer headers with `curlx/` prefix [150]
|
||||
o build: drop unused variables in tests
|
||||
o build: fix libcurltool with cmake and tunits, related tidy-ups [138]
|
||||
o build: split `.c` and `.h` file lists in tests [128]
|
||||
o build: stop checking for `sys/stat.h` [146]
|
||||
o build: stubgss tidy-ups (in tests) [137]
|
||||
o build: sync build scripts between client/libtest [49]
|
||||
o build: tidy up `Makefile.inc` use in lib and src [116]
|
||||
o build: tidy up header paths, use srcdir where possible [42]
|
||||
o cf-socket: make socket data_pending a nop [175]
|
||||
o checksrc-all: rewrite in Perl, remove `checksrc.bat` [217]
|
||||
o checksrc: reduce exceptions, apply again to curlx [114]
|
||||
o cmake/FindGSS: fix processing C header path options [160]
|
||||
o cmake/FindGSS: initialize result variables [159]
|
||||
o cmake: `curl_add_clang_tidy_test_target` tidy-ups [185]
|
||||
o cmake: build `stubgss` library for libtests to match autotools [34]
|
||||
o cmake: check USE_WINDOWS_SSPI when adding secur32 to CURL_LIBS [144]
|
||||
o cmake: configure c-ares header directory in project root (was: lib) [106]
|
||||
o cmake: document OpenSSL and ngtcp2 crypto lib custom variables [29]
|
||||
o cmake: drop never propagated C macros [22]
|
||||
o cmake: drop passing redundant `CURL_STATICLIB` in examples and clients [52]
|
||||
o cmake: drop redundant macro from test clients [51]
|
||||
o cmake: drop reference to future variable
|
||||
o cmake: enable soversion by default for OpenHarmony OS [131]
|
||||
o cmake: fix `curl_add_clang_tidy_test_target` when no `-D` option [155]
|
||||
o cmake: fix generator expression in docs/examples [109]
|
||||
o cmake: gather options recursively in `curl_add_clang_tidy_test_target` [156]
|
||||
o cmake: make docs depend on support files [80]
|
||||
o cmake: move `OUTPUT` argument in the `add_custom_command()` line [50]
|
||||
o cmake: omit clang-tidy on internal libs curlu and curltool [64]
|
||||
o cmake: replace `cmakelint` with `cmake-lint` from `cmakelang`, fix issues [20]
|
||||
o cmake: replace the way clang-tidy verifies tests, fix issues found [101]
|
||||
o cmake: simplify handling generated `lib1521.c` in libtests [24]
|
||||
o cmake: sync `target_link_libraries()` order in tests more [44]
|
||||
o cmake: sync tests scripts by using the variable `BUNDLE` [46]
|
||||
o cmake: sync tests scripts with each other and autotools (more) [100]
|
||||
o cmake: use `target_link_options()` when available [43]
|
||||
o config-win32: fix default targets, shorten macro logic [227]
|
||||
o configure: order LDAP after the SSL libraries
|
||||
o connect: drop unused struct member [209]
|
||||
o connection: clarify `transport` [197]
|
||||
o connection: eliminate member `remote_addr` [10]
|
||||
o curl-config: fix whitespace in usage text [122]
|
||||
o curl.h: make CURL_IPRESOLVE_* symbols defined as longs [206]
|
||||
o curl.h: make CURLSSLOPT_* symbols defined as longs [3]
|
||||
o curl.h: remove the "RESERVED" error codes [2]
|
||||
o curl: implement non-blocking STDIN read on Windows [28]
|
||||
o curl: improve non-blocking STDIN performance [129]
|
||||
o curl: remove the global argument from many functions [218]
|
||||
o curl: unify pointer names to global config [219]
|
||||
o curl_get_line: make sure lines end with newline [110]
|
||||
o curl_memory.h: fix to undefine `accept4` [180]
|
||||
o curl_path: make SFTP handle a path like /~ properly. [11]
|
||||
o curlinfo: provide the 'digest' feature [168]
|
||||
o CURLSHOPT_SHARE.md: mention multi-threading requires callbacks [161]
|
||||
o DEPRECATE.md: add VS2005 removal to the list [214]
|
||||
o digest: fix build with disabled digest auth [72]
|
||||
o DISTROS: update NixOS link
|
||||
o docs,tests: fix english grammar "allow to" -> "allow <something> to" [158]
|
||||
o docs/CONTRIBUTE: fix broken link [173]
|
||||
o docs/examples: add ftp-delete.c [5]
|
||||
o docs: beef up examples/websocket.c [189]
|
||||
o docs: fix broken link in CODE_REVIEW.md [67]
|
||||
o docs: fix broken link in INSTALL.md [68]
|
||||
o docs: fix docs for CURLOPT_PREQUOTE after #17616 [70]
|
||||
o docs: fix documentation of connect_only 2 [78]
|
||||
o docs: fix two typos [163]
|
||||
o docs: mention that the netrc file works without port numbers [112]
|
||||
o docs: mention the as-is concept generically [225]
|
||||
o docs: note SSLS-EXPORT feature in -ssl-sessions doc [199]
|
||||
o docs: reflect that delimiter-separated capath is only OpenSSL [135]
|
||||
o docs: sync -tls-earlydata support w/ CURLOPT_SSL_OPTIONS [198]
|
||||
o docs: warn about lifetime in CURLOPT_CLOSESOCKET* [54]
|
||||
o easy: fix comment-documentation [36]
|
||||
o easygetopt: fix curl logo in header comment [167]
|
||||
o firefox-db2pem: avoid use of eval in script [103]
|
||||
o ftp: fix prequotes for a directory in URL [83]
|
||||
o ftplistparser: split parse_unix into sub functions [77]
|
||||
o h2_serverpush: fix file handle leaks reported by clang-tidy [105]
|
||||
o h3: fix query of concurrent streams [220]
|
||||
o http/3: report handshake with version and cipher as for TCP connections [212]
|
||||
o http2: do not delay RST send on aborted transfer [57]
|
||||
o http2: fix var types in is_alive() implementations [222]
|
||||
o http: explicitly ignore parsing errors for Retry-After [98]
|
||||
o http: fix build with cookies and HSTS disabled [124]
|
||||
o http_ntlm: protect against null deref [95]
|
||||
o http_ntlm: remove unreachable code [88]
|
||||
o INSTALL.md: cygwin details and add source code link [4]
|
||||
o ldap: avoid automake caching issues with LDAP library names
|
||||
o ldap: if ldap-lib is sufficient, add it to LIBS.
|
||||
o ldap: initial support for --with-ldap option
|
||||
o lib2082: drop `typedef struct` [118]
|
||||
o lib: address singleuse issues [132]
|
||||
o lib: avoid reusing unclean connection [73]
|
||||
o lib: drop two interim macros in favor of native libcurl API calls [172]
|
||||
o lib: fix unused parameter/function compiler warnings [186]
|
||||
o lib: make `CURLX_SET_BINMODE()` and use it [39]
|
||||
o lib: make `curlx_wait_ms()` and use it [40]
|
||||
o lib: replace scache no-op macros with `#ifdef` [117]
|
||||
o lib: stop `time()` debug overrides at the end of source in altsvc, hsts [211]
|
||||
o lib: unify recv/send function signatures [92]
|
||||
o libcurl-env.md: drop LOGNAME, USER and NTLMUSER [99]
|
||||
o libcurl.m4: fix indentation [194]
|
||||
o libssh2: remove use of 'initialised' for cleanup [208]
|
||||
o libssh: de-complex myssh_statemach_act() [18]
|
||||
o libssh: fix readdir issues [191]
|
||||
o libtests: make test 1503,1504,1505 use the 1502 binary [90]
|
||||
o libtests: more header tidy-ups [224]
|
||||
o libtests: stop building the sames source multiple times [89]
|
||||
o memdebug.h: #undef `fclose` before defining it
|
||||
o memdebug.h: eliminate global macro `CURL_MT_LOGFNAME_BUFSIZE` [178]
|
||||
o memdebug: include in unity batch [63]
|
||||
o memory: stop overriding unused `wcsdup()`/`_wcsdup()` system functions [204]
|
||||
o memory: tidy up `_tcsdup()` override [202]
|
||||
o misc: fix typos [207]
|
||||
o mk-lib1521: replace `printf` with `curl_mprintf` [141]
|
||||
o multi: add dirty bitset [115]
|
||||
o multi: do no expire a blocked transfer [56]
|
||||
o multi: fix polling with pending input [60]
|
||||
o multi: remove careful bounds check as coverity says it is not needed [174]
|
||||
o multi: xfer table/bitset, handle limits [142]
|
||||
o ngtcp2: fix coverity warning about result handling [166]
|
||||
o openssl: enable readahead [91]
|
||||
o openssl: error on SSL_ERROR_SYSCALL [94]
|
||||
o openssl: fix handling of buffered data [82]
|
||||
o openssl: fix openssl engine use [74]
|
||||
o openssl: fix pkcs11 provider available check [154]
|
||||
o os400: upgrade ILE/RPG bindings with latest definitions. [184]
|
||||
o pingpong: on disconnect, check for unflushed pingpong state [12]
|
||||
o projects/build-openssl.bat: remove [223]
|
||||
o pytest test_07_70, weaken early data check [96]
|
||||
o pytest: adapt for runs with openssl-1.1.1
|
||||
o pytest: disable test_07_37 and test_07_36 with openssl's quic [1]
|
||||
o quic: implement CURLINFO_TLS_SSL_PTR [176]
|
||||
o RELEASE-PROCEDURE.md: update docs/VERSIONS [7]
|
||||
o runtests.pl: fix sprintf() using one too many %s [134]
|
||||
o runtests: fix `LD_PRELOAD` detection for cmake-built curl binaries [123]
|
||||
o runtests: support memory-limits per test [193]
|
||||
o rustls: apply memory function overrides, fixing an ECH buffer free [181]
|
||||
o rustls: don't try printing the not provided file [104]
|
||||
o schannel: allow partial chains for manual peer verification [79]
|
||||
o schannel: drop Windows 2000 compatibility logic [26]
|
||||
o scorecard: flame graphs and documentation [165]
|
||||
o SCP/SFTP: avoid busy loop after EAGAIN [8]
|
||||
o scripts: fix to quote the copyright email address [210]
|
||||
o socks: fix query when filter context is null [221]
|
||||
o system.h: remove some macros [6]
|
||||
o test1117: reduce write delays [9]
|
||||
o test1175: fix to run, and fix documentation issues detected [216]
|
||||
o test1222: fix for out-of-tree and no-libcurl-manual builds [215]
|
||||
o test1499, 1599: use `%LOGDIR` [226]
|
||||
o test1499: verify two chunked responses on reused connection [145]
|
||||
o test1596: let test pass after year 2036 [35]
|
||||
o test1706: pass include directory to `managen` for out-of-tree builds [187]
|
||||
o tests/client: drop autotools logic no longer necessary [45]
|
||||
o tests/client: use `curl_mfprintf()` [48]
|
||||
o tests/dnsd: read config from file [85]
|
||||
o tests/http/clients: drop hack and use `curl_setup.h` again [58]
|
||||
o tests/http/clients: move to tests/client [53]
|
||||
o tests/http/requirements: remove multipart [183]
|
||||
o tests/libtest: call `curlx_now_init()` for unit 1399, 2600 (Windows) [76]
|
||||
o tests/libtest: drop `TEST_HANG_TIMEOUT` redefinition hack [108]
|
||||
o tests/libtest: drop a checksrc exception [119]
|
||||
o tests/libtest: use `curltime` from curlx [71]
|
||||
o tests/server/util.c: include netinet/in6.h [113]
|
||||
o tests/server: de-dupe/merge three `sockdaemon()` clones into one [149]
|
||||
o tests/server: drop `memdebug.h` [111]
|
||||
o tests/server: make all global vars/funcs static [41]
|
||||
o tests/server: move memory init to `memptr.c` [140]
|
||||
o tests/servers.pm: add more ways to figure out current user [17]
|
||||
o tests: always make bundles, adapt build and tests [81]
|
||||
o tests: bundle http clients, de-dupe, enable for MSVC [61]
|
||||
o tests: constify, make consts static [139]
|
||||
o tests: drop `BUNDLE_SRC` variable [59]
|
||||
o tests: drop mk-bundle exceptions [25]
|
||||
o tests: drop unused or redundant includes [153]
|
||||
o tests: drop useless "nodist_SOURCES" assignments [93]
|
||||
o tests: fail torture if !valgrind&threaded resolver [31]
|
||||
o tests: fix 1301, 1308 to fail on error [177]
|
||||
o tests: fix `BUNDLE` variable references in `Makefile.am` [125]
|
||||
o tests: make all names < 75 characters long [182]
|
||||
o tests: make individual test sources compile cleanly [107]
|
||||
o tests: make sshserver less verbose [55]
|
||||
o tests: move `curlcheck.h` to libtest as `unitcheck.h` [171]
|
||||
o tests: move GSS-API dynamic stub into debug-mode libcurl [169]
|
||||
o tests: torture: don't duplicate valgrind command [32]
|
||||
o tests: use %b64[] to base64 data [151]
|
||||
o tests: use %b64[] to base64 data in 2056, 2057 [126]
|
||||
o tftpd: use `CURLMIN()` macro [38]
|
||||
o tidy-up: replace `<memdebug.h>` with `"memdebug.h"` (src, units) [147]
|
||||
o tls: remove Curl_ssl false_start [86]
|
||||
o tool1621: drop unused internal libcurl headers [157]
|
||||
o tool_getparam: fix --ftp-pasv [15]
|
||||
o tool_operate: fix return code when --retry is used but not triggered [13]
|
||||
o tool_paramhelp: fix language in comments [196]
|
||||
o top-complexity: lower max allowed complexity threshold to 90 [33]
|
||||
o unit tests: extract "private" prototypes at build time [170]
|
||||
o unit1302: expand the base64 encode/decode tests [148]
|
||||
o url: fix connection lifetime checks [14]
|
||||
o url: fix NULL deref with bad password when no user is provided [87]
|
||||
o urlapi: simplify and split into sub functions [16]
|
||||
o urlapi: use uppercase hex encoding [133]
|
||||
o vauth: move auth structs to conn meta data [30]
|
||||
o vtls: change send/recv signatures of tls backends [65]
|
||||
o vtls: fix a copy-pasted early data comment typo [200]
|
||||
o vtls: log rustls negotiated KEX group name [201]
|
||||
o vtls: prefer ciphersuite to cipher in msgs [203]
|
||||
o vtls: prefer rustls-ffi ciphersuite name API [205]
|
||||
o VULN-DISCLOSURE-POLICY.md: fix typos [164]
|
||||
o VULN-DISCLOSURE-POLICY: all reports should be disclosed [102]
|
||||
o VULN-DISCLOSURE-POLICY: exclude not installed software [121]
|
||||
o VULN-DISCLOSURE-POLICY: minor language polish [162]
|
||||
o warnless: drop parts of the `read`/`write` preprocessor hack (Windows) [37]
|
||||
o warnless: replace `read()`/`write()` wrapper functions with macros (Windows) [75]
|
||||
o windows: drop redundant `curl_wcsdup_callback` callback [188]
|
||||
o windows: fixup `fopen()` in `CURLDEBUG` builds [62]
|
||||
o windows: reduce/stop loading DLLs at runtime [27]
|
||||
o wolfssl: add support for ML_KEM hybrids [195]
|
||||
o ws: drop redundant `CURL_EXTERN` from function definitions [179]
|
||||
o xfer: manage pause bits [97]
|
||||
|
||||
This release includes the following known bugs:
|
||||
|
||||
See https://curl.se/docs/knownbugs.html
|
||||
|
||||
For all changes ever done in curl:
|
||||
|
||||
See https://curl.se/changes.html
|
||||
|
||||
Planned upcoming removals include:
|
||||
|
||||
o Support for the msh3 HTTP/3 backend
|
||||
o Supporting curl builds using VS2008
|
||||
o The winbuild build system
|
||||
o Windows CE support
|
||||
|
||||
See https://curl.se/dev/deprecate.html
|
||||
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
4lan.m, afengsoft on github, albrechtd on github, Ameda Amahru,
|
||||
Bartosz Ruszczak, behindtheblackwall on hackerone, Bernhard M. Wiedemann,
|
||||
Brad Harder, Brian Harris, Calvin Ruocco, Carlos Henrique Lima Melara,
|
||||
Christian Hesse, Christian Weisgerber, Christopher Boyd, Dan Fandrich,
|
||||
Daniel Gustafsson, Daniel McCarney, Daniel Stenberg, defnull, DoI,
|
||||
Edwin Török, Eshan Kelkar, Ethan Alker, Fabrício Canedo, fjaell on github,
|
||||
hiimmat on github, Jeroen Ooms, Joel Depooter, John Haugabook,
|
||||
Karthik Dasari, Keno Fischer, Kirill Obukhov, Larry Campbell,
|
||||
Luca Kellermann, Luke Wilde, Marcel Lang, Marcel Raad, Markus Unterwaditzer,
|
||||
Max Dymond, Michael Kaufmann, NINIKA, Orgad Shaneh, Patrick Monnerat,
|
||||
Patrick Stoeckle, Piotr Nakraszewicz, Randall S. Becker, Ray Satiro,
|
||||
renovate[bot], Rod Widdowson, Ryan Hooper, SC404, Stefan Eissing,
|
||||
Theodore A. Roth, Tristan Perrault, Viktor Szakats, Yedaya Katsman, z2_
|
||||
(57 contributors)
|
||||
|
||||
References to bug reports and discussions on issues:
|
||||
|
||||
[1] = https://curl.se/bug/?i=17539
|
||||
[2] = https://curl.se/bug/?i=17563
|
||||
[3] = https://curl.se/bug/?i=17535
|
||||
[4] = https://curl.se/bug/?i=17485
|
||||
[5] = https://curl.se/bug/?i=17540
|
||||
[6] = https://curl.se/bug/?i=17498
|
||||
[7] = https://curl.se/bug/?i=17584
|
||||
[8] = https://curl.se/bug/?i=17533
|
||||
[9] = https://curl.se/bug/?i=17530
|
||||
[10] = https://curl.se/bug/?i=17385
|
||||
[11] = https://curl.se/bug/?i=17534
|
||||
[12] = https://curl.se/bug/?i=17555
|
||||
[13] = https://curl.se/bug/?i=17554
|
||||
[14] = https://curl.se/bug/?i=17571
|
||||
[15] = https://curl.se/bug/?i=17545
|
||||
[16] = https://curl.se/bug/?i=17565
|
||||
[17] = https://curl.se/bug/?i=17544
|
||||
[18] = https://curl.se/bug/?i=17573
|
||||
[19] = https://curl.se/bug/?i=16677
|
||||
[20] = https://curl.se/bug/?i=17576
|
||||
[21] = https://curl.se/bug/?i=17522
|
||||
[22] = https://curl.se/bug/?i=17580
|
||||
[23] = https://curl.se/bug/?i=17679
|
||||
[24] = https://curl.se/bug/?i=17676
|
||||
[25] = https://curl.se/bug/?i=17468
|
||||
[26] = https://curl.se/bug/?i=17447
|
||||
[27] = https://curl.se/bug/?i=17413
|
||||
[28] = https://curl.se/bug/?i=17451
|
||||
[29] = https://curl.se/bug/?i=17574
|
||||
[30] = https://curl.se/bug/?i=17557
|
||||
[31] = https://curl.se/bug/?i=17501
|
||||
[32] = https://curl.se/bug/?i=17501
|
||||
[33] = https://curl.se/bug/?i=17689
|
||||
[34] = https://curl.se/bug/?i=17653
|
||||
[35] = https://curl.se/bug/?i=17665
|
||||
[36] = https://curl.se/bug/?i=17664
|
||||
[37] = https://curl.se/bug/?i=17673
|
||||
[38] = https://curl.se/bug/?i=17674
|
||||
[39] = https://curl.se/bug/?i=17672
|
||||
[40] = https://curl.se/bug/?i=17641
|
||||
[41] = https://curl.se/bug/?i=17671
|
||||
[42] = https://curl.se/bug/?i=17630
|
||||
[43] = https://curl.se/bug/?i=17670
|
||||
[44] = https://curl.se/bug/?i=17669
|
||||
[45] = https://curl.se/bug/?i=17668
|
||||
[46] = https://curl.se/bug/?i=17667
|
||||
[47] = https://curl.se/bug/?i=17661
|
||||
[48] = https://curl.se/bug/?i=17651
|
||||
[49] = https://curl.se/bug/?i=17660
|
||||
[50] = https://curl.se/bug/?i=17658
|
||||
[51] = https://curl.se/bug/?i=17657
|
||||
[52] = https://curl.se/bug/?i=17655
|
||||
[53] = https://curl.se/bug/?i=17637
|
||||
[54] = https://curl.se/bug/?i=17816
|
||||
[55] = https://curl.se/bug/?i=17647
|
||||
[56] = https://curl.se/bug/?i=17639
|
||||
[57] = https://curl.se/bug/?i=17611
|
||||
[58] = https://curl.se/bug/?i=17642
|
||||
[59] = https://curl.se/bug/?i=17692
|
||||
[60] = https://curl.se/bug/?i=17636
|
||||
[61] = https://curl.se/bug/?i=17627
|
||||
[62] = https://curl.se/bug/?i=16747
|
||||
[63] = https://curl.se/bug/?i=16746
|
||||
[64] = https://curl.se/bug/?i=17693
|
||||
[65] = https://curl.se/bug/?i=17593
|
||||
[66] = https://curl.se/bug/?i=17632
|
||||
[67] = https://curl.se/bug/?i=17656
|
||||
[68] = https://github.com/curl/curl-www/issues/427
|
||||
[69] = https://curl.se/bug/?i=17581
|
||||
[70] = https://curl.se/bug/?i=17690
|
||||
[71] = https://curl.se/bug/?i=17716
|
||||
[72] = https://curl.se/bug/?i=17612
|
||||
[73] = https://curl.se/bug/?i=17578
|
||||
[74] = https://curl.se/bug/?i=17617
|
||||
[75] = https://curl.se/bug/?i=17619
|
||||
[76] = https://curl.se/bug/?i=17714
|
||||
[77] = https://curl.se/bug/?i=17608
|
||||
[78] = https://curl.se/bug/?i=17621
|
||||
[79] = https://curl.se/bug/?i=17418
|
||||
[80] = https://curl.se/bug/?i=17620
|
||||
[81] = https://curl.se/bug/?i=17590
|
||||
[82] = https://curl.se/bug/?i=17601
|
||||
[83] = https://curl.se/bug/?i=8602
|
||||
[84] = https://curl.se/bug/?i=17602
|
||||
[85] = https://curl.se/bug/?i=17543
|
||||
[86] = https://curl.se/bug/?i=17595
|
||||
[87] = https://curl.se/bug/?i=17659
|
||||
[88] = https://curl.se/bug/?i=17587
|
||||
[89] = https://curl.se/bug/?i=17598
|
||||
[90] = https://curl.se/bug/?i=17591
|
||||
[91] = https://curl.se/bug/?i=17548
|
||||
[92] = https://curl.se/bug/?i=17546
|
||||
[93] = https://curl.se/bug/?i=17688
|
||||
[94] = https://curl.se/bug/?i=17471
|
||||
[95] = https://curl.se/bug/?i=17585
|
||||
[96] = https://curl.se/bug/?i=17575
|
||||
[97] = https://curl.se/bug/?i=17650
|
||||
[98] = https://curl.se/bug/?i=17682
|
||||
[99] = https://curl.se/bug/?i=17713
|
||||
[100] = https://curl.se/bug/?i=17711
|
||||
[101] = https://curl.se/bug/?i=17705
|
||||
[102] = https://curl.se/bug/?i=17778
|
||||
[103] = https://curl.se/bug/?i=17766
|
||||
[104] = https://curl.se/bug/?i=17704
|
||||
[105] = https://curl.se/bug/?i=17706
|
||||
[106] = https://curl.se/bug/?i=17707
|
||||
[107] = https://curl.se/bug/?i=17703
|
||||
[108] = https://curl.se/bug/?i=17702
|
||||
[109] = https://curl.se/bug/?i=17767
|
||||
[110] = https://curl.se/bug/?i=17697
|
||||
[111] = https://curl.se/bug/?i=17700
|
||||
[112] = https://curl.se/bug/?i=17698
|
||||
[113] = https://curl.se/mail/lib-2025-06/0016.html
|
||||
[114] = https://curl.se/bug/?i=17764
|
||||
[115] = https://curl.se/bug/?i=17662
|
||||
[116] = https://curl.se/bug/?i=17694
|
||||
[117] = https://curl.se/bug/?i=17754
|
||||
[118] = https://curl.se/bug/?i=17763
|
||||
[119] = https://curl.se/bug/?i=17762
|
||||
[120] = https://curl.se/bug/?i=17396
|
||||
[121] = https://curl.se/bug/?i=17761
|
||||
[122] = https://curl.se/bug/?i=17758
|
||||
[123] = https://curl.se/bug/?i=17756
|
||||
[124] = https://curl.se/bug/?i=17753
|
||||
[125] = https://curl.se/bug/?i=17750
|
||||
[126] = https://curl.se/bug/?i=17748
|
||||
[127] = https://curl.se/bug/?i=17747
|
||||
[128] = https://curl.se/bug/?i=17745
|
||||
[129] = https://curl.se/bug/?i=17566
|
||||
[130] = https://curl.se/bug/?i=17678
|
||||
[131] = https://curl.se/bug/?i=17743
|
||||
[132] = https://curl.se/bug/?i=17734
|
||||
[133] = https://curl.se/bug/?i=17685
|
||||
[134] = https://curl.se/bug/?i=17740
|
||||
[135] = https://curl.se/bug/?i=17737
|
||||
[136] = https://curl.se/bug/?i=17742
|
||||
[137] = https://curl.se/bug/?i=17738
|
||||
[138] = https://curl.se/bug/?i=17727
|
||||
[139] = https://curl.se/bug/?i=17736
|
||||
[140] = https://curl.se/bug/?i=17735
|
||||
[141] = https://curl.se/bug/?i=17732
|
||||
[142] = https://curl.se/bug/?i=17731
|
||||
[143] = https://curl.se/bug/?i=17730
|
||||
[144] = https://curl.se/bug/?i=17728
|
||||
[145] = https://curl.se/bug/?i=17815
|
||||
[146] = https://curl.se/bug/?i=17724
|
||||
[147] = https://curl.se/bug/?i=17722
|
||||
[148] = https://curl.se/bug/?i=17726
|
||||
[149] = https://curl.se/bug/?i=17719
|
||||
[150] = https://curl.se/bug/?i=17680
|
||||
[151] = https://curl.se/bug/?i=17721
|
||||
[152] = https://curl.se/bug/?i=17720
|
||||
[153] = https://curl.se/bug/?i=17717
|
||||
[154] = https://curl.se/bug/?i=17804
|
||||
[155] = https://curl.se/bug/?i=17813
|
||||
[156] = https://curl.se/bug/?i=17812
|
||||
[157] = https://curl.se/bug/?i=17811
|
||||
[158] = https://curl.se/bug/?i=17787
|
||||
[159] = https://curl.se/bug/?i=17806
|
||||
[160] = https://curl.se/bug/?i=17805
|
||||
[161] = https://curl.se/bug/?i=17774
|
||||
[162] = https://curl.se/bug/?i=17799
|
||||
[163] = https://curl.se/bug/?i=17795
|
||||
[164] = https://curl.se/bug/?i=17796
|
||||
[165] = https://curl.se/bug/?i=17792
|
||||
[166] = https://curl.se/bug/?i=17783
|
||||
[167] = https://curl.se/bug/?i=17793
|
||||
[168] = https://curl.se/bug/?i=17786
|
||||
[169] = https://curl.se/bug/?i=17752
|
||||
[170] = https://curl.se/bug/?i=17750
|
||||
[171] = https://curl.se/bug/?i=17868
|
||||
[172] = https://curl.se/bug/?i=17772
|
||||
[173] = https://curl.se/bug/?i=17780
|
||||
[174] = https://curl.se/bug/?i=17784
|
||||
[175] = https://curl.se/bug/?i=17785
|
||||
[176] = https://curl.se/bug/?i=17801
|
||||
[177] = https://curl.se/bug/?i=17867
|
||||
[178] = https://curl.se/bug/?i=17833
|
||||
[179] = https://curl.se/bug/?i=17832
|
||||
[180] = https://curl.se/bug/?i=17831
|
||||
[181] = https://curl.se/bug/?i=17830
|
||||
[182] = https://curl.se/bug/?i=17824
|
||||
[183] = https://curl.se/bug/?i=17825
|
||||
[184] = https://curl.se/bug/?i=17822
|
||||
[185] = https://curl.se/bug/?i=17814
|
||||
[186] = https://curl.se/bug/?i=17818
|
||||
[187] = https://curl.se/bug/?i=17926
|
||||
[188] = https://curl.se/bug/?i=17843
|
||||
[189] = https://curl.se/bug/?i=13288
|
||||
[190] = https://curl.se/bug/?i=17917
|
||||
[191] = https://curl.se/bug/?i=17856
|
||||
[193] = https://curl.se/bug/?i=17821
|
||||
[194] = https://curl.se/bug/?i=17913
|
||||
[195] = https://curl.se/bug/?i=17902
|
||||
[196] = https://curl.se/bug/?i=17895
|
||||
[197] = https://curl.se/bug/?i=17923
|
||||
[198] = https://curl.se/bug/?i=17909
|
||||
[199] = https://curl.se/bug/?i=17909
|
||||
[200] = https://curl.se/bug/?i=17907
|
||||
[201] = https://curl.se/bug/?i=17906
|
||||
[202] = https://curl.se/bug/?i=17845
|
||||
[203] = https://curl.se/bug/?i=17906
|
||||
[204] = https://curl.se/bug/?i=17840
|
||||
[205] = https://curl.se/bug/?i=17906
|
||||
[206] = https://curl.se/bug/?i=17790
|
||||
[207] = https://curl.se/bug/?i=17904
|
||||
[208] = https://curl.se/bug/?i=17819
|
||||
[209] = https://curl.se/bug/?i=17908
|
||||
[210] = https://curl.se/bug/?i=17903
|
||||
[211] = https://curl.se/bug/?i=17897
|
||||
[212] = https://curl.se/bug/?i=17922
|
||||
[214] = https://curl.se/bug/?i=17934
|
||||
[215] = https://curl.se/bug/?i=17892
|
||||
[216] = https://curl.se/bug/?i=17880
|
||||
[217] = https://curl.se/bug/?i=17882
|
||||
[218] = https://curl.se/bug/?i=17890
|
||||
[219] = https://curl.se/bug/?i=17888
|
||||
[220] = https://curl.se/bug/?i=17886
|
||||
[221] = https://curl.se/bug/?i=17885
|
||||
[222] = https://curl.se/bug/?i=17881
|
||||
[223] = https://curl.se/bug/?i=17879
|
||||
[224] = https://curl.se/bug/?i=17875
|
||||
[225] = https://curl.se/bug/?i=17829
|
||||
[226] = https://curl.se/bug/?i=17871
|
||||
[227] = https://curl.se/bug/?i=17916
|
||||
File diff suppressed because it is too large
Load Diff
1249
curl-8.15.0/curl-8.15.0/aclocal.m4
vendored
1249
curl-8.15.0/curl-8.15.0/aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
||||
# This is a generated file. Do not edit.
|
||||
buildinfo.configure.tool: configure
|
||||
buildinfo.configure.args: '--disable-shared' '--enable-static' '--with-openssl=/home/teknari/Sync/Programming/VibeCoding/nostr_core_lib/openssl-install' '--without-libpsl' '--without-brotli' '--disable-ldap' '--disable-ldaps' '--disable-rtsp' '--disable-proxy' '--disable-dict' '--disable-telnet' '--disable-tftp' '--disable-pop3' '--disable-imap' '--disable-smb' '--disable-smtp' '--disable-gopher' '--disable-manual' '--prefix=/home/teknari/Sync/Programming/VibeCoding/nostr_core_lib/curl-install'
|
||||
buildinfo.host: x86_64-pc-linux-gnu
|
||||
buildinfo.host.cpu: x86_64
|
||||
buildinfo.host.os: linux-gnu
|
||||
buildinfo.target: x86_64-pc-linux-gnu
|
||||
buildinfo.target.cpu: x86_64
|
||||
buildinfo.target.os: linux-gnu
|
||||
buildinfo.target.flags: UNIX UNIX GCC
|
||||
buildinfo.compiler: GNU_C
|
||||
buildinfo.compiler.version: 11
|
||||
buildinfo.sysroot:
|
||||
@@ -1,348 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN* | MSYS*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/* | msys/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
1754
curl-8.15.0/curl-8.15.0/config.guess
vendored
1754
curl-8.15.0/curl-8.15.0/config.guess
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1890
curl-8.15.0/curl-8.15.0/config.sub
vendored
1890
curl-8.15.0/curl-8.15.0/config.sub
vendored
File diff suppressed because it is too large
Load Diff
48388
curl-8.15.0/curl-8.15.0/configure
vendored
48388
curl-8.15.0/curl-8.15.0/configure
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,189 +0,0 @@
|
||||
#!/bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# shellcheck disable=SC2006
|
||||
|
||||
prefix='/home/teknari/Sync/Programming/VibeCoding/nostr_core_lib/curl-install'
|
||||
# Used in 'libdir'
|
||||
# shellcheck disable=SC2034
|
||||
exec_prefix="${prefix}"
|
||||
# shellcheck disable=SC2034
|
||||
includedir="${prefix}/include"
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<EOF
|
||||
Usage: curl-config [OPTION]
|
||||
|
||||
Available values for OPTION include:
|
||||
|
||||
--built-shared says 'yes' if libcurl was built shared
|
||||
--ca CA bundle install path
|
||||
--cc compiler
|
||||
--cflags preprocessor and compiler flags
|
||||
--checkfor [version] check for (lib)curl of the specified version
|
||||
--configure the arguments given to configure when building curl
|
||||
--features newline separated list of enabled features
|
||||
--help display this help and exit
|
||||
--libs library linking information
|
||||
--prefix curl install prefix
|
||||
--protocols newline separated list of enabled protocols
|
||||
--ssl-backends output the SSL backends libcurl was built to support
|
||||
--static-libs static libcurl library linking information
|
||||
--version output version information
|
||||
--vernum output version as a hexadecimal number
|
||||
EOF
|
||||
|
||||
exit "$1"
|
||||
}
|
||||
|
||||
if test "$#" -eq 0; then
|
||||
usage 1
|
||||
fi
|
||||
|
||||
while test "$#" -gt 0; do
|
||||
case "$1" in
|
||||
--built-shared)
|
||||
echo 'no'
|
||||
;;
|
||||
|
||||
--ca)
|
||||
echo '/etc/ssl/certs/ca-certificates.crt'
|
||||
;;
|
||||
|
||||
--cc)
|
||||
echo 'gcc'
|
||||
;;
|
||||
|
||||
--prefix)
|
||||
echo "$prefix"
|
||||
;;
|
||||
|
||||
--feature|--features)
|
||||
for feature in alt-svc AsynchDNS HSTS IPv6 Largefile libz NTLM SSL threadsafe TLS-SRP UnixSockets ''; do
|
||||
test -n "$feature" && echo "$feature"
|
||||
done
|
||||
;;
|
||||
|
||||
--protocols)
|
||||
# shellcheck disable=SC2043
|
||||
for protocol in FILE FTP FTPS HTTP HTTPS IPFS IPNS MQTT WS WSS; do
|
||||
echo "$protocol"
|
||||
done
|
||||
;;
|
||||
|
||||
--version)
|
||||
echo 'libcurl 8.15.0'
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--checkfor)
|
||||
checkfor="$2"
|
||||
cmajor=`echo "$checkfor" | cut -d. -f1`
|
||||
cminor=`echo "$checkfor" | cut -d. -f2`
|
||||
# when extracting the patch part we strip off everything after a
|
||||
# dash as that's used for things like version 1.2.3-pre1
|
||||
cpatch=`echo "$checkfor" | cut -d. -f3 | cut -d- -f1`
|
||||
|
||||
vmajor=`echo '8.15.0' | cut -d. -f1`
|
||||
vminor=`echo '8.15.0' | cut -d. -f2`
|
||||
# when extracting the patch part we strip off everything after a
|
||||
# dash as that's used for things like version 1.2.3-pre1
|
||||
vpatch=`echo '8.15.0' | cut -d. -f3 | cut -d- -f1`
|
||||
|
||||
if test "$vmajor" -gt "$cmajor"; then
|
||||
exit 0
|
||||
fi
|
||||
if test "$vmajor" -eq "$cmajor"; then
|
||||
if test "$vminor" -gt "$cminor"; then
|
||||
exit 0
|
||||
fi
|
||||
if test "$vminor" -eq "$cminor"; then
|
||||
if test "$cpatch" -le "$vpatch"; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "requested version $checkfor is newer than existing 8.15.0"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
--vernum)
|
||||
echo '080f00'
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--help)
|
||||
usage 0
|
||||
;;
|
||||
|
||||
--cflags)
|
||||
if test "X${prefix}/include" = 'X/usr/include'; then
|
||||
echo '-DCURL_STATICLIB'
|
||||
else
|
||||
echo "-DCURL_STATICLIB -I${prefix}/include"
|
||||
fi
|
||||
;;
|
||||
|
||||
--libs)
|
||||
if test "X${exec_prefix}/lib" != 'X/usr/lib' -a "X${exec_prefix}/lib" != 'X/usr/lib64'; then
|
||||
curllibdir="-L${exec_prefix}/lib "
|
||||
else
|
||||
curllibdir=''
|
||||
fi
|
||||
if test 'Xno' = 'Xno'; then
|
||||
echo "${curllibdir}-lcurl -lssl -lcrypto -lssl -lcrypto -lz"
|
||||
else
|
||||
echo "${curllibdir}-lcurl"
|
||||
fi
|
||||
;;
|
||||
|
||||
--ssl-backends)
|
||||
echo 'OpenSSL v3+'
|
||||
;;
|
||||
|
||||
--static-libs)
|
||||
if test 'Xyes' != 'Xno'; then
|
||||
echo "${exec_prefix}/lib/libcurl.a -L/home/teknari/Sync/Programming/VibeCoding/nostr_core_lib/openssl-3.4.2/../openssl-install/lib64 -lssl -lcrypto -lssl -lcrypto -lz"
|
||||
else
|
||||
echo 'curl was built with static libraries disabled' >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
--configure)
|
||||
echo " '--disable-shared' '--enable-static' '--with-openssl=/home/teknari/Sync/Programming/VibeCoding/nostr_core_lib/openssl-install' '--without-libpsl' '--without-brotli' '--disable-ldap' '--disable-ldaps' '--disable-rtsp' '--disable-proxy' '--disable-dict' '--disable-telnet' '--disable-tftp' '--disable-pop3' '--disable-imap' '--disable-smb' '--disable-smtp' '--disable-gopher' '--disable-manual' '--prefix=/home/teknari/Sync/Programming/VibeCoding/nostr_core_lib/curl-install'"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "unknown option: $1"
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,189 +0,0 @@
|
||||
#!/bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# shellcheck disable=SC2006
|
||||
|
||||
prefix='@prefix@'
|
||||
# Used in 'libdir'
|
||||
# shellcheck disable=SC2034
|
||||
exec_prefix="@exec_prefix@"
|
||||
# shellcheck disable=SC2034
|
||||
includedir="@includedir@"
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<EOF
|
||||
Usage: curl-config [OPTION]
|
||||
|
||||
Available values for OPTION include:
|
||||
|
||||
--built-shared says 'yes' if libcurl was built shared
|
||||
--ca CA bundle install path
|
||||
--cc compiler
|
||||
--cflags preprocessor and compiler flags
|
||||
--checkfor [version] check for (lib)curl of the specified version
|
||||
--configure the arguments given to configure when building curl
|
||||
--features newline separated list of enabled features
|
||||
--help display this help and exit
|
||||
--libs library linking information
|
||||
--prefix curl install prefix
|
||||
--protocols newline separated list of enabled protocols
|
||||
--ssl-backends output the SSL backends libcurl was built to support
|
||||
--static-libs static libcurl library linking information
|
||||
--version output version information
|
||||
--vernum output version as a hexadecimal number
|
||||
EOF
|
||||
|
||||
exit "$1"
|
||||
}
|
||||
|
||||
if test "$#" -eq 0; then
|
||||
usage 1
|
||||
fi
|
||||
|
||||
while test "$#" -gt 0; do
|
||||
case "$1" in
|
||||
--built-shared)
|
||||
echo '@ENABLE_SHARED@'
|
||||
;;
|
||||
|
||||
--ca)
|
||||
echo '@CURL_CA_BUNDLE@'
|
||||
;;
|
||||
|
||||
--cc)
|
||||
echo '@CC@'
|
||||
;;
|
||||
|
||||
--prefix)
|
||||
echo "$prefix"
|
||||
;;
|
||||
|
||||
--feature|--features)
|
||||
for feature in @SUPPORT_FEATURES@ ''; do
|
||||
test -n "$feature" && echo "$feature"
|
||||
done
|
||||
;;
|
||||
|
||||
--protocols)
|
||||
# shellcheck disable=SC2043
|
||||
for protocol in @SUPPORT_PROTOCOLS@; do
|
||||
echo "$protocol"
|
||||
done
|
||||
;;
|
||||
|
||||
--version)
|
||||
echo 'libcurl @CURLVERSION@'
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--checkfor)
|
||||
checkfor="$2"
|
||||
cmajor=`echo "$checkfor" | cut -d. -f1`
|
||||
cminor=`echo "$checkfor" | cut -d. -f2`
|
||||
# when extracting the patch part we strip off everything after a
|
||||
# dash as that's used for things like version 1.2.3-pre1
|
||||
cpatch=`echo "$checkfor" | cut -d. -f3 | cut -d- -f1`
|
||||
|
||||
vmajor=`echo '@CURLVERSION@' | cut -d. -f1`
|
||||
vminor=`echo '@CURLVERSION@' | cut -d. -f2`
|
||||
# when extracting the patch part we strip off everything after a
|
||||
# dash as that's used for things like version 1.2.3-pre1
|
||||
vpatch=`echo '@CURLVERSION@' | cut -d. -f3 | cut -d- -f1`
|
||||
|
||||
if test "$vmajor" -gt "$cmajor"; then
|
||||
exit 0
|
||||
fi
|
||||
if test "$vmajor" -eq "$cmajor"; then
|
||||
if test "$vminor" -gt "$cminor"; then
|
||||
exit 0
|
||||
fi
|
||||
if test "$vminor" -eq "$cminor"; then
|
||||
if test "$cpatch" -le "$vpatch"; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "requested version $checkfor is newer than existing @CURLVERSION@"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
--vernum)
|
||||
echo '@VERSIONNUM@'
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--help)
|
||||
usage 0
|
||||
;;
|
||||
|
||||
--cflags)
|
||||
if test "X@includedir@" = 'X/usr/include'; then
|
||||
echo '@LIBCURL_PC_CFLAGS@'
|
||||
else
|
||||
echo "@LIBCURL_PC_CFLAGS@ -I@includedir@"
|
||||
fi
|
||||
;;
|
||||
|
||||
--libs)
|
||||
if test "X@libdir@" != 'X/usr/lib' -a "X@libdir@" != 'X/usr/lib64'; then
|
||||
curllibdir="-L@libdir@ "
|
||||
else
|
||||
curllibdir=''
|
||||
fi
|
||||
if test 'X@ENABLE_SHARED@' = 'Xno'; then
|
||||
echo "${curllibdir}-lcurl @LIBCURL_PC_LIBS_PRIVATE@"
|
||||
else
|
||||
echo "${curllibdir}-lcurl"
|
||||
fi
|
||||
;;
|
||||
|
||||
--ssl-backends)
|
||||
echo '@SSL_BACKENDS@'
|
||||
;;
|
||||
|
||||
--static-libs)
|
||||
if test 'X@ENABLE_STATIC@' != 'Xno'; then
|
||||
echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@"
|
||||
else
|
||||
echo 'curl was built with static libraries disabled' >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
--configure)
|
||||
echo @CONFIGURE_OPTIONS@
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "unknown option: $1"
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,791 +0,0 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by 'PROGRAMS ARGS'.
|
||||
object Object file output by 'PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputting dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get the directory component of the given path, and save it in the
|
||||
# global variables '$dir'. Note that this directory component will
|
||||
# be either empty or ending with a '/' character. This is deliberate.
|
||||
set_dir_from ()
|
||||
{
|
||||
case $1 in
|
||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
||||
*) dir=;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Get the suffix-stripped basename of the given path, and save it the
|
||||
# global variable '$base'.
|
||||
set_base_from ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
||||
}
|
||||
|
||||
# If no dependency file was actually created by the compiler invocation,
|
||||
# we still have to create a dummy depfile, to avoid errors with the
|
||||
# Makefile "include basename.Plo" scheme.
|
||||
make_dummy_depfile ()
|
||||
{
|
||||
echo "#dummy" > "$depfile"
|
||||
}
|
||||
|
||||
# Factor out some common post-processing of the generated depfile.
|
||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
||||
aix_post_process_depfile ()
|
||||
{
|
||||
# If the compiler actually managed to produce a dependency file,
|
||||
# post-process it.
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependency.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# $object: dependency.h
|
||||
# and one to simply output
|
||||
# dependency.h:
|
||||
# which is needed to avoid the deleted-header problem.
|
||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
||||
} > "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
}
|
||||
|
||||
# A tabulation character.
|
||||
tab=' '
|
||||
# A newline character.
|
||||
nl='
|
||||
'
|
||||
# Character ranges might be problematic outside the C locale.
|
||||
# These definitions help.
|
||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
lower=abcdefghijklmnopqrstuvwxyz
|
||||
digits=0123456789
|
||||
alpha=${upper}${lower}
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Avoid interferences from the environment.
|
||||
gccflag= dashmflag=
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
cygpath_u="cygpath -u -f -"
|
||||
if test "$depmode" = msvcmsys; then
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
fi
|
||||
|
||||
if test "$depmode" = msvc7msys; then
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
fi
|
||||
|
||||
if test "$depmode" = xlc; then
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
|
||||
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
|
||||
## (see the conditional assignment to $gccflag above).
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||
## supported by the other compilers which use the 'gcc' depmode.
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The second -e expression handles DOS-style file names with drive
|
||||
# letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the "deleted header file" problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
## Some versions of gcc put a space before the ':'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||
## to the object. Take care to not repeat it in the output.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
||||
| tr "$nl" ' ' >> "$depfile"
|
||||
echo >> "$depfile"
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
xlc)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
tcc)
|
||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
||||
# FIXME: That version still under development at the moment of writing.
|
||||
# Make that this statement remains true also for stable, released
|
||||
# versions.
|
||||
# It will wrap lines (doesn't matter whether long or short) with a
|
||||
# trailing '\', as in:
|
||||
#
|
||||
# foo.o : \
|
||||
# foo.c \
|
||||
# foo.h \
|
||||
#
|
||||
# It will put a trailing '\' even on the last line, and will use leading
|
||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
||||
# "Emit spaces for -MD").
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
||||
# We have to change lines of the first kind to '$object: \'.
|
||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
||||
# dummy dependency, to avoid the deleted-header problem.
|
||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
## The order of this option in the case statement is important, since the
|
||||
## shell code in configure will try each of these formats in the order
|
||||
## listed in this file. A plain '-MD' option would be understood by many
|
||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
||||
pgcc)
|
||||
# Portland's C compiler understands '-MD'.
|
||||
# Will always output deps to 'file.d' where file is the root name of the
|
||||
# source file under compilation, even if file resides in a subdirectory.
|
||||
# The object file name does not affect the name of the '.d' file.
|
||||
# pgcc 10.2 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\' :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
set_dir_from "$object"
|
||||
# Use the source, not the object, to determine the base name, since
|
||||
# that's sadly what pgcc will do too.
|
||||
set_base_from "$source"
|
||||
tmpdepfile=$base.d
|
||||
|
||||
# For projects that build the same source file twice into different object
|
||||
# files, the pgcc approach of using the *source* file root name can cause
|
||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
||||
# the same $tmpdepfile.
|
||||
lockdir=$base.d-lock
|
||||
trap "
|
||||
echo '$0: caught signal, cleaning up...' >&2
|
||||
rmdir '$lockdir'
|
||||
exit 1
|
||||
" 1 2 13 15
|
||||
numtries=100
|
||||
i=$numtries
|
||||
while test $i -gt 0; do
|
||||
# mkdir is a portable test-and-set.
|
||||
if mkdir "$lockdir" 2>/dev/null; then
|
||||
# This process acquired the lock.
|
||||
"$@" -MD
|
||||
stat=$?
|
||||
# Release the lock.
|
||||
rmdir "$lockdir"
|
||||
break
|
||||
else
|
||||
# If the lock is being held by a different process, wait
|
||||
# until the winning process is done or we timeout.
|
||||
while test -d "$lockdir" && test $i -gt 0; do
|
||||
sleep 1
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
fi
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
trap - 1 2 13 15
|
||||
if test $i -le 0; then
|
||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
||||
echo "$0: check lockdir '$lockdir'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add 'dependent.h:' lines.
|
||||
sed -ne '2,${
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
# Same post-processing that is required for AIX mode.
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
msvc7)
|
||||
if test "$libtool" = yes; then
|
||||
showIncludes=-Wc,-showIncludes
|
||||
else
|
||||
showIncludes=-showIncludes
|
||||
fi
|
||||
"$@" $showIncludes > "$tmpdepfile"
|
||||
stat=$?
|
||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The first sed program below extracts the file names and escapes
|
||||
# backslashes for cygpath. The second sed program outputs the file
|
||||
# name when reading, but also accumulates all include files in the
|
||||
# hold buffer in order to output them again at the end. This only
|
||||
# works with sed implementations that can handle large buffers.
|
||||
sed < "$tmpdepfile" -n '
|
||||
/^Note: including file: *\(.*\)/ {
|
||||
s//\1/
|
||||
s/\\/\\\\/g
|
||||
p
|
||||
}' | $cygpath_u | sort -u | sed -n '
|
||||
s/ /\\ /g
|
||||
s/\(.*\)/'"$tab"'\1 \\/p
|
||||
s/.\(.*\) \\/\1:/
|
||||
H
|
||||
$ {
|
||||
s/.*/'"$tab"'/
|
||||
G
|
||||
p
|
||||
}' >> "$depfile"
|
||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvc7msys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for ':'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no eat=no
|
||||
for arg
|
||||
do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
if test $eat = yes; then
|
||||
eat=no
|
||||
continue
|
||||
fi
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-arch)
|
||||
eat=yes ;;
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix=`echo "$object" | sed 's/^.*\././'`
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
# makedepend may prepend the VPATH from the source file name to the object.
|
||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed '1,2d' "$tmpdepfile" \
|
||||
| tr ' ' "$nl" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E \
|
||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E 2>/dev/null |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
||||
echo "$tab" >> "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvcmsys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
@@ -1,43 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Alt-Svc
|
||||
|
||||
curl features support for the Alt-Svc: HTTP header.
|
||||
|
||||
## Enable Alt-Svc in build
|
||||
|
||||
`./configure --enable-alt-svc`
|
||||
|
||||
(enabled by default since 7.73.0)
|
||||
|
||||
## Standard
|
||||
|
||||
[RFC 7838](https://datatracker.ietf.org/doc/html/rfc7838)
|
||||
|
||||
# Alt-Svc cache file format
|
||||
|
||||
This is a text based file with one line per entry and each line consists of nine
|
||||
space separated fields.
|
||||
|
||||
## Example
|
||||
|
||||
h2 quic.tech 8443 h3-22 quic.tech 8443 "20190808 06:18:37" 0 0
|
||||
|
||||
## Fields
|
||||
|
||||
1. The ALPN id for the source origin
|
||||
2. The hostname for the source origin
|
||||
3. The port number for the source origin
|
||||
4. The ALPN id for the destination host
|
||||
5. The hostname for the destination host
|
||||
6. The port number for the destination host
|
||||
7. The expiration date and time of this entry within double quotes. The date format is "YYYYMMDD HH:MM:SS" and the time zone is GMT.
|
||||
8. Boolean (1 or 0) if "persist" was set for this entry
|
||||
9. Integer priority value (not currently used)
|
||||
|
||||
If the hostname is an IPv6 numerical address, it is stored with brackets such
|
||||
as `[::1]`.
|
||||
@@ -1,148 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
libcurl bindings
|
||||
================
|
||||
|
||||
Creative people have written bindings or interfaces for various environments
|
||||
and programming languages. Using one of these allows you to take advantage of
|
||||
curl powers from within your favourite language or system.
|
||||
|
||||
This is a list of all known interfaces as of this writing.
|
||||
|
||||
The bindings listed below are not part of the curl/libcurl distribution
|
||||
archives, but must be downloaded and installed separately.
|
||||
|
||||
<!-- markdown-link-check-disable -->
|
||||
|
||||
[Ada95](https://web.archive.org/web/20070403105909/www.almroth.com/adacurl/index.html) Written by Andreas Almroth
|
||||
|
||||
[Basic](https://scriptbasic.com/) ScriptBasic bindings written by Peter Verhas
|
||||
|
||||
C++: [curlpp](https://github.com/jpbarrette/curlpp/) Written by Jean-Philippe Barrette-LaPierre,
|
||||
[curlcpp](https://github.com/JosephP91/curlcpp) by Giuseppe Persico and [C++
|
||||
Requests](https://github.com/libcpr/cpr) by Huu Nguyen
|
||||
|
||||
[Ch](https://chcurl.sourceforge.net/) Written by Stephen Nestinger and Jonathan Rogado
|
||||
|
||||
Cocoa: [BBHTTP](https://github.com/biasedbit/BBHTTP) written by Bruno de Carvalho
|
||||
[curlhandle](https://github.com/karelia/curlhandle) Written by Dan Wood
|
||||
|
||||
Clojure: [clj-curl](https://github.com/lsevero/clj-curl) by Lucas Severo
|
||||
|
||||
[D](https://dlang.org/library/std/net/curl.html) Written by Kenneth Bogert
|
||||
|
||||
[Delphi](https://github.com/Mercury13/curl4delphi) Written by Mikhail Merkuryev
|
||||
|
||||
[Dylan](https://dylanlibs.sourceforge.net/) Written by Chris Double
|
||||
|
||||
[Eiffel](https://iron.eiffel.com/repository/20.11/package/ABEF6975-37AC-45FD-9C67-52D10BA0669B) Written by Eiffel Software
|
||||
|
||||
[Euphoria](https://web.archive.org/web/20050204080544/rays-web.com/eulibcurl.htm) Written by Ray Smith
|
||||
|
||||
[Falcon](http://www.falconpl.org/project_docs/curl/)
|
||||
|
||||
[Ferite](https://web.archive.org/web/20150102192018/ferite.org/) Written by Paul Querna
|
||||
|
||||
[Fortran](https://github.com/interkosmos/fortran-curl) Written by Philipp Engel
|
||||
|
||||
[Gambas](https://gambas.sourceforge.net/)
|
||||
|
||||
[glib/GTK+](https://web.archive.org/web/20100526203452/atterer.net/glibcurl) Written by Richard Atterer
|
||||
|
||||
Go: [go-curl](https://github.com/andelf/go-curl) by ShuYu Wang
|
||||
|
||||
[Guile](https://github.com/spk121/guile-curl) Written by Michael L. Gran
|
||||
|
||||
[Harbour](https://github.com/vszakats/hb/tree/main/contrib/hbcurl) Written by Viktor Szakats
|
||||
|
||||
[Haskell](https://hackage.haskell.org/package/curl) Written by Galois, Inc
|
||||
|
||||
[Hollywood](https://www.hollywood-mal.com/download.html) hURL by Andreas Falkenhahn
|
||||
|
||||
[Java](https://github.com/covers1624/curl4j)
|
||||
|
||||
[Julia](https://github.com/JuliaWeb/LibCURL.jl) Written by Amit Murthy
|
||||
|
||||
[Kapito](https://github.com/puzza007/katipo) is an Erlang HTTP library around libcurl.
|
||||
|
||||
[Lisp](https://common-lisp.net/project/cl-curl/) Written by Liam Healy
|
||||
|
||||
Lua: [luacurl](https://web.archive.org/web/20201205052437/luacurl.luaforge.net/) by Alexander Marinov, [Lua-cURL](https://github.com/Lua-cURL) by Jürgen Hötzel
|
||||
|
||||
[Mono](https://web.archive.org/web/20070606064500/https://forge.novell.com/modules/xfmod/project/?libcurl-mono) Written by Jeffrey Phillips
|
||||
|
||||
[.NET](https://sourceforge.net/projects/libcurl-net/) libcurl-net by Jeffrey Phillips
|
||||
|
||||
[Nim](https://nimble.directory/pkg/libcurl) wrapper for libcurl
|
||||
|
||||
[node.js](https://github.com/JCMais/node-libcurl) node-libcurl by Jonathan Cardoso Machado
|
||||
|
||||
[Object-Pascal](https://web.archive.org/web/20020610214926/www.tekool.com/opcurl) Free Pascal, Delphi and Kylix binding written by Christophe Espern.
|
||||
|
||||
[OCaml](https://opam.ocaml.org/packages/ocurl/) Written by Lars Nilsson and ygrek
|
||||
|
||||
[Pascal](https://web.archive.org/web/20030804091414/houston.quik.com/jkp/curlpas/) Free Pascal, Delphi and Kylix binding written by Jeffrey Pohlmeyer.
|
||||
|
||||
Perl: [WWW::Curl](https://github.com/szbalint/WWW--Curl) Maintained by Cris
|
||||
Bailiff and Bálint Szilakszi,
|
||||
[perl6-net-curl](https://github.com/azawawi/perl6-net-curl) by Ahmad M. Zawawi
|
||||
[NET::Curl](https://metacpan.org/pod/Net::Curl) by Przemyslaw Iskra
|
||||
|
||||
[PHP](https://php.net/curl) Originally written by Sterling Hughes
|
||||
|
||||
[PostgreSQL](https://github.com/pramsey/pgsql-http) - HTTP client for PostgreSQL
|
||||
|
||||
[PostgreSQL](https://github.com/RekGRpth/pg_curl) - cURL client for PostgreSQL
|
||||
|
||||
[PureBasic](https://www.purebasic.com/documentation/http/index.html) uses libcurl in its "native" HTTP subsystem
|
||||
|
||||
[Python](http://pycurl.io/) PycURL by Kjetil Jacobsen
|
||||
|
||||
[Python](https://pypi.org/project/pymcurl/) mcurl by Ganesh Viswanathan
|
||||
|
||||
[Q](https://q-lang.sourceforge.net/) The libcurl module is part of the default install
|
||||
|
||||
[R](https://cran.r-project.org/package=curl)
|
||||
|
||||
[Rexx](https://rexxcurl.sourceforge.net/) Written Mark Hessling
|
||||
|
||||
[Ring](https://ring-lang.sourceforge.io/doc1.3/libcurl.html) RingLibCurl by Mahmoud Fayed
|
||||
|
||||
RPG, support for ILE/RPG on OS/400 is included in source distribution
|
||||
|
||||
Ruby: [curb](https://github.com/taf2/curb) written by Ross Bamford,
|
||||
[ruby-curl-multi](https://github.com/kball/curl_multi.rb) by Kristjan Petursson and Keith Rarick
|
||||
|
||||
[Rust](https://github.com/alexcrichton/curl-rust) curl-rust - by Carl Lerche
|
||||
|
||||
[Scheme](https://www.metapaper.net/lisovsky/web/curl/) Bigloo binding by Kirill Lisovsky
|
||||
|
||||
[Scilab](https://help.scilab.org/docs/current/fr_FR/getURL.html) binding by Sylvestre Ledru
|
||||
|
||||
[S-Lang](https://www.jedsoft.org/slang/modules/curl.html) by John E Davis
|
||||
|
||||
[Smalltalk](https://www.squeaksource.com/CurlPlugin/) Written by Danil Osipchuk
|
||||
|
||||
[SP-Forth](https://sourceforge.net/p/spf/spf/ci/master/tree/devel/~ac/lib/lin/curl/) Written by Andrey Cherezov
|
||||
|
||||
[SPL](https://web.archive.org/web/20210203022158/www.clifford.at/spl/spldoc/curl.html) Written by Clifford Wolf
|
||||
|
||||
[Tcl](https://web.archive.org/web/20160826011806/mirror.yellow5.com/tclcurl/) Tclcurl by Andrés García
|
||||
|
||||
[Vibe](https://github.com/ttytm/vibe) HTTP requests through libcurl in V
|
||||
|
||||
[Visual Basic](https://sourceforge.net/projects/libcurl-vb/) libcurl-vb by Jeffrey Phillips
|
||||
|
||||
[Visual Foxpro](https://web.archive.org/web/20130730181523/www.ctl32.com.ar/libcurl.asp) by Carlos Alloatti
|
||||
|
||||
[wxWidgets](https://wxcode.sourceforge.net/components/wxcurl/) Written by Casey O'Donnell
|
||||
|
||||
[XBLite](https://web.archive.org/web/20060426150418/perso.wanadoo.fr/xblite/libraries.html) Written by David Szafranski
|
||||
|
||||
[Xojo](https://github.com/charonn0/RB-libcURL) Written by Andrew Lambert
|
||||
|
||||
[Zig](https://github.com/jiacai2050/zig-curl) Written by Jiacai Liu, both easy and multi API are supported.
|
||||
@@ -1,93 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# The curl bug bounty
|
||||
|
||||
The curl project runs a bug bounty program in association with
|
||||
[HackerOne](https://www.hackerone.com) and the [Internet Bug
|
||||
Bounty](https://internetbugbounty.org).
|
||||
|
||||
## How does it work?
|
||||
|
||||
Start out by posting your suspected security vulnerability directly to [curl's
|
||||
HackerOne program](https://hackerone.com/curl).
|
||||
|
||||
After you have reported a security issue, it has been deemed credible, and a
|
||||
patch and advisory has been made public, you may be eligible for a bounty from
|
||||
this program. See the [Security Process](https://curl.se/dev/secprocess.html)
|
||||
document for how we work with security issues.
|
||||
|
||||
## What are the reward amounts?
|
||||
|
||||
The curl project offers monetary compensation for reported and published
|
||||
security vulnerabilities. The amount of money that is rewarded depends on how
|
||||
serious the flaw is determined to be.
|
||||
|
||||
Since 2021, the Bug Bounty is managed in association with the Internet Bug
|
||||
Bounty and they set the reward amounts. If it would turn out that they set
|
||||
amounts that are way lower than we can accept, the curl project intends to
|
||||
"top up" rewards.
|
||||
|
||||
In 2025, typical "Medium" rated vulnerabilities are rewarded 2,500 USD each.
|
||||
|
||||
## Who is eligible for a reward?
|
||||
|
||||
Everyone and anyone who reports a security problem in a released curl version
|
||||
that has not already been reported can ask for a bounty.
|
||||
|
||||
Dedicated - paid for - security audits that are performed in collaboration
|
||||
with curl developers are not eligible for bounties.
|
||||
|
||||
Vulnerabilities in features that are off by default and documented as
|
||||
experimental are not eligible for a reward.
|
||||
|
||||
The vulnerability has to be fixed and publicly announced (by the curl project)
|
||||
before a bug bounty is considered.
|
||||
|
||||
Once the vulnerability has been published by curl, the researcher can request
|
||||
their bounty from the [Internet Bug Bounty](https://hackerone.com/ibb).
|
||||
|
||||
Bounties need to be requested within twelve months from the publication of the
|
||||
vulnerability.
|
||||
|
||||
The curl security team reserves themselves the right to deny or allow bug
|
||||
bounty payouts on its own discretion. There is no appeals process.
|
||||
|
||||
## Product vulnerabilities only
|
||||
|
||||
This bug bounty only concerns the curl and libcurl products and thus their
|
||||
respective source codes - when running on existing hardware. It does not
|
||||
include curl documentation, curl websites, or other curl related
|
||||
infrastructure.
|
||||
|
||||
The curl security team is the sole arbiter if a reported flaw is subject to a
|
||||
bounty or not.
|
||||
|
||||
## Third parties
|
||||
|
||||
The curl bug bounty does not cover flaws in third party dependencies
|
||||
(libraries) used by curl or libcurl. If the bug triggers because of curl
|
||||
behaving wrongly or abusing a third party dependency, the problem is rather in
|
||||
curl and not in the dependency and then the bounty might cover the problem.
|
||||
|
||||
## How are vulnerabilities graded?
|
||||
|
||||
The grading of each reported vulnerability that makes a reward claim is
|
||||
performed by the curl security team. The grading is based on the CVSS (Common
|
||||
Vulnerability Scoring System) 3.0.
|
||||
|
||||
## How are reward amounts determined?
|
||||
|
||||
The curl security team gives the vulnerability a score or severity level, as
|
||||
mentioned above. The actual monetary reward amount is decided and paid by the
|
||||
Internet Bug Bounty..
|
||||
|
||||
## Regarding taxes, etc. on the bounties
|
||||
|
||||
In the event that the individual receiving a bug bounty needs to pay taxes on
|
||||
the reward money, the responsibility lies with the receiver. The curl project
|
||||
or its security team never actually receive any of this money, hold the money,
|
||||
or pay out the money.
|
||||
@@ -1,270 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# BUGS
|
||||
|
||||
## There are still bugs
|
||||
|
||||
curl and libcurl keep being developed. Adding features and changing code
|
||||
means that bugs sneak in, no matter how hard we try to keep them out.
|
||||
|
||||
Of course there are lots of bugs left. Not to mention misfeatures.
|
||||
|
||||
To help us make curl the stable and solid product we want it to be, we need
|
||||
bug reports and bug fixes.
|
||||
|
||||
## Where to report
|
||||
|
||||
If you cannot fix a bug yourself and submit a fix for it, try to report an as
|
||||
detailed report as possible to a curl mailing list to allow one of us to have
|
||||
a go at a solution. You can optionally also submit your problem in [curl's
|
||||
bug tracking system](https://github.com/curl/curl/issues).
|
||||
|
||||
Please read the rest of this document below first before doing that.
|
||||
|
||||
If you feel you need to ask around first, find a suitable [mailing
|
||||
list](https://curl.se/mail/) and post your questions there.
|
||||
|
||||
## Security bugs
|
||||
|
||||
If you find a bug or problem in curl or libcurl that you think has a security
|
||||
impact, for example a bug that can put users in danger or make them
|
||||
vulnerable if the bug becomes public knowledge, then please report that bug
|
||||
using our security development process.
|
||||
|
||||
Security related bugs or bugs that are suspected to have a security impact,
|
||||
should be reported on the [curl security tracker at
|
||||
HackerOne](https://hackerone.com/curl).
|
||||
|
||||
This ensures that the report reaches the curl security team so that they
|
||||
first can deal with the report away from the public to minimize the harm and
|
||||
impact it has on existing users out there who might be using the vulnerable
|
||||
versions.
|
||||
|
||||
The curl project's process for handling security related issues is
|
||||
[documented separately](https://curl.se/dev/secprocess.html).
|
||||
|
||||
## What to report
|
||||
|
||||
When reporting a bug, you should include all information to help us
|
||||
understand what is wrong, what you expected to happen and how to repeat the
|
||||
bad behavior. You therefore need to tell us:
|
||||
|
||||
- your operating system's name and version number
|
||||
|
||||
- what version of curl you are using (`curl -V` is fine)
|
||||
|
||||
- versions of the used libraries that libcurl is built to use
|
||||
|
||||
- what URL you were working with (if possible), at least which protocol
|
||||
|
||||
and anything and everything else you think matters. Tell us what you expected
|
||||
to happen, tell us what did happen, tell us how you could make it work
|
||||
another way. Dig around, try out, test. Then include all the tiny bits and
|
||||
pieces in your report. You benefit from this yourself, as it enables us to
|
||||
help you quicker and more accurately.
|
||||
|
||||
Since curl deals with networks, it often helps us if you include a protocol
|
||||
debug dump with your bug report. The output you get by using the `-v` or
|
||||
`--trace` options.
|
||||
|
||||
If curl crashed, causing a core dump (in Unix), there is hardly any use to
|
||||
send that huge file to anyone of us. Unless we have the same system setup as
|
||||
you, we cannot do much with it. Instead, we ask you to get a stack trace and
|
||||
send that (much smaller) output to us instead.
|
||||
|
||||
The address and how to subscribe to the mailing lists are detailed in the
|
||||
`MANUAL.md` file.
|
||||
|
||||
## libcurl problems
|
||||
|
||||
When you have written your own application with libcurl to perform transfers,
|
||||
it is even more important to be specific and detailed when reporting bugs.
|
||||
|
||||
Tell us the libcurl version and your operating system. Tell us the name and
|
||||
version of all relevant sub-components like for example the SSL library
|
||||
you are using and what name resolving your libcurl uses. If you use SFTP or
|
||||
SCP, the libssh2 version is relevant etc.
|
||||
|
||||
Showing us a real source code example repeating your problem is the best way
|
||||
to get our attention and it greatly increases our chances to understand your
|
||||
problem and to work on a fix (if we agree it truly is a problem).
|
||||
|
||||
Lots of problems that appear to be libcurl problems are actually just abuses
|
||||
of the libcurl API or other malfunctions in your applications. It is advised
|
||||
that you run your problematic program using a memory debug tool like valgrind
|
||||
or similar before you post memory-related or "crashing" problems to us.
|
||||
|
||||
## Who fixes the problems
|
||||
|
||||
If the problems or bugs you describe are considered to be bugs, we want to
|
||||
have the problems fixed.
|
||||
|
||||
There are no developers in the curl project that are paid to work on bugs.
|
||||
All developers that take on reported bugs do this on a voluntary basis. We do
|
||||
it out of an ambition to keep curl and libcurl excellent products and out of
|
||||
pride.
|
||||
|
||||
Please do not assume that you can just lump over something to us and it then
|
||||
magically gets fixed after some given time. Most often we need feedback and
|
||||
help to understand what you have experienced and how to repeat a problem.
|
||||
Then we may only be able to assist YOU to debug the problem and to track down
|
||||
the proper fix.
|
||||
|
||||
We get reports from many people every month and each report can take a
|
||||
considerable amount of time to really go to the bottom with.
|
||||
|
||||
## How to get a stack trace
|
||||
|
||||
First, you must make sure that you compile all sources with `-g` and that you
|
||||
do not 'strip' the final executable. Try to avoid optimizing the code as well,
|
||||
remove `-O`, `-O2` etc from the compiler options.
|
||||
|
||||
Run the program until it cores.
|
||||
|
||||
Run your debugger on the core file, like `<debugger> curl core`. `<debugger>`
|
||||
should be replaced with the name of your debugger, in most cases that is
|
||||
`gdb`, but `dbx` and others also occur.
|
||||
|
||||
When the debugger has finished loading the core file and presents you a
|
||||
prompt, enter `where` (without quotes) and press return.
|
||||
|
||||
The list that is presented is the stack trace. If everything worked, it is
|
||||
supposed to contain the chain of functions that were called when curl
|
||||
crashed. Include the stack trace with your detailed bug report, it helps a
|
||||
lot.
|
||||
|
||||
## Bugs in libcurl bindings
|
||||
|
||||
There are of course bugs in libcurl bindings. You should then primarily
|
||||
approach the team that works on that particular binding and see what you can
|
||||
do to help them fix the problem.
|
||||
|
||||
If you suspect that the problem exists in the underlying libcurl, then please
|
||||
convert your program over to plain C and follow the steps outlined above.
|
||||
|
||||
## Bugs in old versions
|
||||
|
||||
The curl project typically releases new versions every other month, and we
|
||||
fix several hundred bugs per year. For a huge table of releases, number of
|
||||
bug fixes and more, see: https://curl.se/docs/releases.html
|
||||
|
||||
The developers in the curl project do not have bandwidth or energy enough to
|
||||
maintain several branches or to spend much time on hunting down problems in
|
||||
old versions when chances are we already fixed them or at least that they have
|
||||
changed nature and appearance in later versions.
|
||||
|
||||
When you experience a problem and want to report it, you really SHOULD
|
||||
include the version number of the curl you are using when you experience the
|
||||
issue. If that version number shows us that you are using an out-of-date curl,
|
||||
you should also try out a modern curl version to see if the problem persists
|
||||
or how/if it has changed in appearance.
|
||||
|
||||
Even if you cannot immediately upgrade your application/system to run the
|
||||
latest curl version, you can most often at least run a test version or
|
||||
experimental build or similar, to get this confirmed or not.
|
||||
|
||||
At times people insist that they cannot upgrade to a modern curl version, but
|
||||
instead, they "just want the bug fixed". That is fine, just do not count on us
|
||||
spending many cycles on trying to identify which single commit, if that is
|
||||
even possible, that at some point in the past fixed the problem you are now
|
||||
experiencing.
|
||||
|
||||
Security wise, it is almost always a bad idea to lag behind the current curl
|
||||
versions by a lot. We keep discovering and reporting security problems
|
||||
over time see you can see in [this
|
||||
table](https://curl.se/docs/vulnerabilities.html)
|
||||
|
||||
# Bug fixing procedure
|
||||
|
||||
## What happens on first filing
|
||||
|
||||
When a new issue is posted in the issue tracker or on the mailing list, the
|
||||
team of developers first needs to see the report. Maybe they took the day off,
|
||||
maybe they are off in the woods hunting. Have patience. Allow at least a few
|
||||
days before expecting someone to have responded.
|
||||
|
||||
In the issue tracker, you can expect that some labels are set on the issue to
|
||||
help categorize it.
|
||||
|
||||
## First response
|
||||
|
||||
If your issue/bug report was not perfect at once (and few are), chances are
|
||||
that someone asks follow-up questions. Which version did you use? Which
|
||||
options did you use? How often does the problem occur? How can we reproduce
|
||||
this problem? Which protocols does it involve? Or perhaps much more specific
|
||||
and deep diving questions. It all depends on your specific issue.
|
||||
|
||||
You should then respond to these follow-up questions and provide more info
|
||||
about the problem, so that we can help you figure it out. Or maybe you can
|
||||
help us figure it out. An active back-and-forth communication is important
|
||||
and the key for finding a cure and landing a fix.
|
||||
|
||||
## Not reproducible
|
||||
|
||||
We may require further work from you who actually see or experience the
|
||||
problem if we cannot reproduce it and cannot understand it even after having
|
||||
gotten all the info we need and having studied the source code over again.
|
||||
|
||||
## Unresponsive
|
||||
|
||||
If the problem have not been understood or reproduced, and there is nobody
|
||||
responding to follow-up questions or questions asking for clarifications or
|
||||
for discussing possible ways to move forward with the task, we take that as a
|
||||
strong suggestion that the bug is unimportant.
|
||||
|
||||
Unimportant issues are closed as inactive sooner or later as they cannot be
|
||||
fixed. The inactivity period (waiting for responses) should not be shorter
|
||||
than two weeks but may extend months.
|
||||
|
||||
## Lack of time/interest
|
||||
|
||||
Bugs that are filed and are understood can unfortunately end up in the
|
||||
"nobody cares enough about it to work on it" category. Such bugs are
|
||||
perfectly valid problems that *should* get fixed but apparently are not. We
|
||||
try to mark such bugs as `KNOWN_BUGS material` after a time of inactivity and
|
||||
if no activity is noticed after yet some time those bugs are added to the
|
||||
`KNOWN_BUGS` document and are closed in the issue tracker.
|
||||
|
||||
## `KNOWN_BUGS`
|
||||
|
||||
This is a list of known bugs. Bugs we know exist and that have been pointed
|
||||
out but that have not yet been fixed. The reasons for why they have not been
|
||||
fixed can involve anything really, but the primary reason is that nobody has
|
||||
considered these problems to be important enough to spend the necessary time
|
||||
and effort to have them fixed.
|
||||
|
||||
The `KNOWN_BUGS` items are always up for grabs and we love the ones who bring
|
||||
one of them back to life and offer solutions to them.
|
||||
|
||||
The `KNOWN_BUGS` document has a sibling document known as `TODO`.
|
||||
|
||||
## `TODO`
|
||||
|
||||
Issues that are filed or reported that are not really bugs but more missing
|
||||
features or ideas for future improvements and so on are marked as
|
||||
*enhancement* or *feature-request* and get added to the `TODO` document and
|
||||
the issues are closed. We do not keep TODO items open in the issue tracker.
|
||||
|
||||
The `TODO` document is full of ideas and suggestions of what we can add or
|
||||
fix one day. You are always encouraged and free to grab one of those items and
|
||||
take up a discussion with the curl development team on how that could be
|
||||
implemented or provided in the project so that you can work on ticking it odd
|
||||
that document.
|
||||
|
||||
If an issue is rather a bug and not a missing feature or functionality, it is
|
||||
listed in `KNOWN_BUGS` instead.
|
||||
|
||||
## Closing off stalled bugs
|
||||
|
||||
The [issue and pull request trackers](https://github.com/curl/curl) only hold
|
||||
"active" entries open (using a non-precise definition of what active actually
|
||||
is, but they are at least not completely dead). Those that are abandoned or
|
||||
in other ways dormant are closed and sometimes added to `TODO` and
|
||||
`KNOWN_BUGS` instead.
|
||||
|
||||
This way, we only have "active" issues open on GitHub. Irrelevant issues and
|
||||
pull requests do not distract developers or casual visitors.
|
||||
@@ -1,336 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# TLS 1.2 cipher suites
|
||||
|
||||
| Id | IANA name | OpenSSL name | RFC |
|
||||
|--------|-----------------------------------------------|------------------------------------|--------------------|
|
||||
| 0x0001 | TLS_RSA_WITH_NULL_MD5 | NULL-MD5 | [RFC5246] |
|
||||
| 0x0002 | TLS_RSA_WITH_NULL_SHA | NULL-SHA | [RFC5246] |
|
||||
| 0x0003 | TLS_RSA_EXPORT_WITH_RC4_40_MD5 | EXP-RC4-MD5 | [RFC4346][RFC6347] |
|
||||
| 0x0004 | TLS_RSA_WITH_RC4_128_MD5 | RC4-MD5 | [RFC5246][RFC6347] |
|
||||
| 0x0005 | TLS_RSA_WITH_RC4_128_SHA | RC4-SHA | [RFC5246][RFC6347] |
|
||||
| 0x0006 | TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 | EXP-RC2-CBC-MD5 | [RFC4346] |
|
||||
| 0x0007 | TLS_RSA_WITH_IDEA_CBC_SHA | IDEA-CBC-SHA | [RFC8996] |
|
||||
| 0x0008 | TLS_RSA_EXPORT_WITH_DES40_CBC_SHA | EXP-DES-CBC-SHA | [RFC4346] |
|
||||
| 0x0009 | TLS_RSA_WITH_DES_CBC_SHA | DES-CBC-SHA | [RFC8996] |
|
||||
| 0x000A | TLS_RSA_WITH_3DES_EDE_CBC_SHA | DES-CBC3-SHA | [RFC5246] |
|
||||
| 0x000B | TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA | EXP-DH-DSS-DES-CBC-SHA | [RFC4346] |
|
||||
| 0x000C | TLS_DH_DSS_WITH_DES_CBC_SHA | DH-DSS-DES-CBC-SHA | [RFC8996] |
|
||||
| 0x000D | TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA | DH-DSS-DES-CBC3-SHA | [RFC5246] |
|
||||
| 0x000E | TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA | EXP-DH-RSA-DES-CBC-SHA | [RFC4346] |
|
||||
| 0x000F | TLS_DH_RSA_WITH_DES_CBC_SHA | DH-RSA-DES-CBC-SHA | [RFC8996] |
|
||||
| 0x0010 | TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA | DH-RSA-DES-CBC3-SHA | [RFC5246] |
|
||||
| 0x0011 | TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA | EXP-DHE-DSS-DES-CBC-SHA | [RFC4346] |
|
||||
| 0x0012 | TLS_DHE_DSS_WITH_DES_CBC_SHA | DHE-DSS-DES-CBC-SHA | [RFC8996] |
|
||||
| 0x0013 | TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA | DHE-DSS-DES-CBC3-SHA | [RFC5246] |
|
||||
| 0x0014 | TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA | EXP-DHE-RSA-DES-CBC-SHA | [RFC4346] |
|
||||
| 0x0015 | TLS_DHE_RSA_WITH_DES_CBC_SHA | DHE-RSA-DES-CBC-SHA | [RFC8996] |
|
||||
| 0x0016 | TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA | DHE-RSA-DES-CBC3-SHA | [RFC5246] |
|
||||
| 0x0017 | TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 | EXP-ADH-RC4-MD5 | [RFC4346][RFC6347] |
|
||||
| 0x0018 | TLS_DH_anon_WITH_RC4_128_MD5 | ADH-RC4-MD5 | [RFC5246][RFC6347] |
|
||||
| 0x0019 | TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA | EXP-ADH-DES-CBC-SHA | [RFC4346] |
|
||||
| 0x001A | TLS_DH_anon_WITH_DES_CBC_SHA | ADH-DES-CBC-SHA | [RFC8996] |
|
||||
| 0x001B | TLS_DH_anon_WITH_3DES_EDE_CBC_SHA | ADH-DES-CBC3-SHA | [RFC5246] |
|
||||
| 0x001C | | FZA-NULL-SHA | |
|
||||
| 0x001D | | FZA-FZA-CBC-SHA | |
|
||||
| 0x001E | TLS_KRB5_WITH_DES_CBC_SHA | KRB5-DES-CBC-SHA | [RFC2712] |
|
||||
| 0x001F | TLS_KRB5_WITH_3DES_EDE_CBC_SHA | KRB5-DES-CBC3-SHA | [RFC2712] |
|
||||
| 0x0020 | TLS_KRB5_WITH_RC4_128_SHA | KRB5-RC4-SHA | [RFC2712][RFC6347] |
|
||||
| 0x0021 | TLS_KRB5_WITH_IDEA_CBC_SHA | KRB5-IDEA-CBC-SHA | [RFC2712] |
|
||||
| 0x0022 | TLS_KRB5_WITH_DES_CBC_MD5 | KRB5-DES-CBC-MD5 | [RFC2712] |
|
||||
| 0x0023 | TLS_KRB5_WITH_3DES_EDE_CBC_MD5 | KRB5-DES-CBC3-MD5 | [RFC2712] |
|
||||
| 0x0024 | TLS_KRB5_WITH_RC4_128_MD5 | KRB5-RC4-MD5 | [RFC2712][RFC6347] |
|
||||
| 0x0025 | TLS_KRB5_WITH_IDEA_CBC_MD5 | KRB5-IDEA-CBC-MD5 | [RFC2712] |
|
||||
| 0x0026 | TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA | EXP-KRB5-DES-CBC-SHA | [RFC2712] |
|
||||
| 0x0027 | TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA | EXP-KRB5-RC2-CBC-SHA | [RFC2712] |
|
||||
| 0x0028 | TLS_KRB5_EXPORT_WITH_RC4_40_SHA | EXP-KRB5-RC4-SHA | [RFC2712][RFC6347] |
|
||||
| 0x0029 | TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 | EXP-KRB5-DES-CBC-MD5 | [RFC2712] |
|
||||
| 0x002A | TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 | EXP-KRB5-RC2-CBC-MD5 | [RFC2712] |
|
||||
| 0x002B | TLS_KRB5_EXPORT_WITH_RC4_40_MD5 | EXP-KRB5-RC4-MD5 | [RFC2712][RFC6347] |
|
||||
| 0x002C | TLS_PSK_WITH_NULL_SHA | PSK-NULL-SHA | [RFC4785] |
|
||||
| 0x002D | TLS_DHE_PSK_WITH_NULL_SHA | DHE-PSK-NULL-SHA | [RFC4785] |
|
||||
| 0x002E | TLS_RSA_PSK_WITH_NULL_SHA | RSA-PSK-NULL-SHA | [RFC4785] |
|
||||
| 0x002F | TLS_RSA_WITH_AES_128_CBC_SHA | AES128-SHA | [RFC5246] |
|
||||
| 0x0030 | TLS_DH_DSS_WITH_AES_128_CBC_SHA | DH-DSS-AES128-SHA | [RFC5246] |
|
||||
| 0x0031 | TLS_DH_RSA_WITH_AES_128_CBC_SHA | DH-RSA-AES128-SHA | [RFC5246] |
|
||||
| 0x0032 | TLS_DHE_DSS_WITH_AES_128_CBC_SHA | DHE-DSS-AES128-SHA | [RFC5246] |
|
||||
| 0x0033 | TLS_DHE_RSA_WITH_AES_128_CBC_SHA | DHE-RSA-AES128-SHA | [RFC5246] |
|
||||
| 0x0034 | TLS_DH_anon_WITH_AES_128_CBC_SHA | ADH-AES128-SHA | [RFC5246] |
|
||||
| 0x0035 | TLS_RSA_WITH_AES_256_CBC_SHA | AES256-SHA | [RFC5246] |
|
||||
| 0x0036 | TLS_DH_DSS_WITH_AES_256_CBC_SHA | DH-DSS-AES256-SHA | [RFC5246] |
|
||||
| 0x0037 | TLS_DH_RSA_WITH_AES_256_CBC_SHA | DH-RSA-AES256-SHA | [RFC5246] |
|
||||
| 0x0038 | TLS_DHE_DSS_WITH_AES_256_CBC_SHA | DHE-DSS-AES256-SHA | [RFC5246] |
|
||||
| 0x0039 | TLS_DHE_RSA_WITH_AES_256_CBC_SHA | DHE-RSA-AES256-SHA | [RFC5246] |
|
||||
| 0x003A | TLS_DH_anon_WITH_AES_256_CBC_SHA | ADH-AES256-SHA | [RFC5246] |
|
||||
| 0x003B | TLS_RSA_WITH_NULL_SHA256 | NULL-SHA256 | [RFC5246] |
|
||||
| 0x003C | TLS_RSA_WITH_AES_128_CBC_SHA256 | AES128-SHA256 | [RFC5246] |
|
||||
| 0x003D | TLS_RSA_WITH_AES_256_CBC_SHA256 | AES256-SHA256 | [RFC5246] |
|
||||
| 0x003E | TLS_DH_DSS_WITH_AES_128_CBC_SHA256 | DH-DSS-AES128-SHA256 | [RFC5246] |
|
||||
| 0x003F | TLS_DH_RSA_WITH_AES_128_CBC_SHA256 | DH-RSA-AES128-SHA256 | [RFC5246] |
|
||||
| 0x0040 | TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 | DHE-DSS-AES128-SHA256 | [RFC5246] |
|
||||
| 0x0041 | TLS_RSA_WITH_CAMELLIA_128_CBC_SHA | CAMELLIA128-SHA | [RFC5932] |
|
||||
| 0x0042 | TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA | DH-DSS-CAMELLIA128-SHA | [RFC5932] |
|
||||
| 0x0043 | TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA | DH-RSA-CAMELLIA128-SHA | [RFC5932] |
|
||||
| 0x0044 | TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA | DHE-DSS-CAMELLIA128-SHA | [RFC5932] |
|
||||
| 0x0045 | TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA | DHE-RSA-CAMELLIA128-SHA | [RFC5932] |
|
||||
| 0x0046 | TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA | ADH-CAMELLIA128-SHA | [RFC5932] |
|
||||
| 0x0060 | | EXP1024-RC4-MD5 | |
|
||||
| 0x0061 | | EXP1024-RC2-CBC-MD5 | |
|
||||
| 0x0062 | | EXP1024-DES-CBC-SHA | |
|
||||
| 0x0063 | | EXP1024-DHE-DSS-DES-CBC-SHA | |
|
||||
| 0x0064 | | EXP1024-RC4-SHA | |
|
||||
| 0x0065 | | EXP1024-DHE-DSS-RC4-SHA | |
|
||||
| 0x0066 | | DHE-DSS-RC4-SHA | |
|
||||
| 0x0067 | TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 | DHE-RSA-AES128-SHA256 | [RFC5246] |
|
||||
| 0x0068 | TLS_DH_DSS_WITH_AES_256_CBC_SHA256 | DH-DSS-AES256-SHA256 | [RFC5246] |
|
||||
| 0x0069 | TLS_DH_RSA_WITH_AES_256_CBC_SHA256 | DH-RSA-AES256-SHA256 | [RFC5246] |
|
||||
| 0x006A | TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 | DHE-DSS-AES256-SHA256 | [RFC5246] |
|
||||
| 0x006B | TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 | DHE-RSA-AES256-SHA256 | [RFC5246] |
|
||||
| 0x006C | TLS_DH_anon_WITH_AES_128_CBC_SHA256 | ADH-AES128-SHA256 | [RFC5246] |
|
||||
| 0x006D | TLS_DH_anon_WITH_AES_256_CBC_SHA256 | ADH-AES256-SHA256 | [RFC5246] |
|
||||
| 0x0080 | | GOST94-GOST89-GOST89 | |
|
||||
| 0x0081 | | GOST2001-GOST89-GOST89 | |
|
||||
| 0x0082 | | GOST94-NULL-GOST94 | |
|
||||
| 0x0083 | | GOST2001-NULL-GOST94 | |
|
||||
| 0x0084 | TLS_RSA_WITH_CAMELLIA_256_CBC_SHA | CAMELLIA256-SHA | [RFC5932] |
|
||||
| 0x0085 | TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA | DH-DSS-CAMELLIA256-SHA | [RFC5932] |
|
||||
| 0x0086 | TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA | DH-RSA-CAMELLIA256-SHA | [RFC5932] |
|
||||
| 0x0087 | TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA | DHE-DSS-CAMELLIA256-SHA | [RFC5932] |
|
||||
| 0x0088 | TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA | DHE-RSA-CAMELLIA256-SHA | [RFC5932] |
|
||||
| 0x0089 | TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA | ADH-CAMELLIA256-SHA | [RFC5932] |
|
||||
| 0x008A | TLS_PSK_WITH_RC4_128_SHA | PSK-RC4-SHA | [RFC4279][RFC6347] |
|
||||
| 0x008B | TLS_PSK_WITH_3DES_EDE_CBC_SHA | PSK-3DES-EDE-CBC-SHA | [RFC4279] |
|
||||
| 0x008C | TLS_PSK_WITH_AES_128_CBC_SHA | PSK-AES128-CBC-SHA | [RFC4279] |
|
||||
| 0x008D | TLS_PSK_WITH_AES_256_CBC_SHA | PSK-AES256-CBC-SHA | [RFC4279] |
|
||||
| 0x008E | TLS_DHE_PSK_WITH_RC4_128_SHA | DHE-PSK-RC4-SHA | [RFC4279][RFC6347] |
|
||||
| 0x008F | TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA | DHE-PSK-3DES-EDE-CBC-SHA | [RFC4279] |
|
||||
| 0x0090 | TLS_DHE_PSK_WITH_AES_128_CBC_SHA | DHE-PSK-AES128-CBC-SHA | [RFC4279] |
|
||||
| 0x0091 | TLS_DHE_PSK_WITH_AES_256_CBC_SHA | DHE-PSK-AES256-CBC-SHA | [RFC4279] |
|
||||
| 0x0092 | TLS_RSA_PSK_WITH_RC4_128_SHA | RSA-PSK-RC4-SHA | [RFC4279][RFC6347] |
|
||||
| 0x0093 | TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA | RSA-PSK-3DES-EDE-CBC-SHA | [RFC4279] |
|
||||
| 0x0094 | TLS_RSA_PSK_WITH_AES_128_CBC_SHA | RSA-PSK-AES128-CBC-SHA | [RFC4279] |
|
||||
| 0x0095 | TLS_RSA_PSK_WITH_AES_256_CBC_SHA | RSA-PSK-AES256-CBC-SHA | [RFC4279] |
|
||||
| 0x0096 | TLS_RSA_WITH_SEED_CBC_SHA | SEED-SHA | [RFC4162] |
|
||||
| 0x0097 | TLS_DH_DSS_WITH_SEED_CBC_SHA | DH-DSS-SEED-SHA | [RFC4162] |
|
||||
| 0x0098 | TLS_DH_RSA_WITH_SEED_CBC_SHA | DH-RSA-SEED-SHA | [RFC4162] |
|
||||
| 0x0099 | TLS_DHE_DSS_WITH_SEED_CBC_SHA | DHE-DSS-SEED-SHA | [RFC4162] |
|
||||
| 0x009A | TLS_DHE_RSA_WITH_SEED_CBC_SHA | DHE-RSA-SEED-SHA | [RFC4162] |
|
||||
| 0x009B | TLS_DH_anon_WITH_SEED_CBC_SHA | ADH-SEED-SHA | [RFC4162] |
|
||||
| 0x009C | TLS_RSA_WITH_AES_128_GCM_SHA256 | AES128-GCM-SHA256 | [RFC5288] |
|
||||
| 0x009D | TLS_RSA_WITH_AES_256_GCM_SHA384 | AES256-GCM-SHA384 | [RFC5288] |
|
||||
| 0x009E | TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 | DHE-RSA-AES128-GCM-SHA256 | [RFC5288] |
|
||||
| 0x009F | TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 | DHE-RSA-AES256-GCM-SHA384 | [RFC5288] |
|
||||
| 0x00A0 | TLS_DH_RSA_WITH_AES_128_GCM_SHA256 | DH-RSA-AES128-GCM-SHA256 | [RFC5288] |
|
||||
| 0x00A1 | TLS_DH_RSA_WITH_AES_256_GCM_SHA384 | DH-RSA-AES256-GCM-SHA384 | [RFC5288] |
|
||||
| 0x00A2 | TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 | DHE-DSS-AES128-GCM-SHA256 | [RFC5288] |
|
||||
| 0x00A3 | TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 | DHE-DSS-AES256-GCM-SHA384 | [RFC5288] |
|
||||
| 0x00A4 | TLS_DH_DSS_WITH_AES_128_GCM_SHA256 | DH-DSS-AES128-GCM-SHA256 | [RFC5288] |
|
||||
| 0x00A5 | TLS_DH_DSS_WITH_AES_256_GCM_SHA384 | DH-DSS-AES256-GCM-SHA384 | [RFC5288] |
|
||||
| 0x00A6 | TLS_DH_anon_WITH_AES_128_GCM_SHA256 | ADH-AES128-GCM-SHA256 | [RFC5288] |
|
||||
| 0x00A7 | TLS_DH_anon_WITH_AES_256_GCM_SHA384 | ADH-AES256-GCM-SHA384 | [RFC5288] |
|
||||
| 0x00A8 | TLS_PSK_WITH_AES_128_GCM_SHA256 | PSK-AES128-GCM-SHA256 | [RFC5487] |
|
||||
| 0x00A9 | TLS_PSK_WITH_AES_256_GCM_SHA384 | PSK-AES256-GCM-SHA384 | [RFC5487] |
|
||||
| 0x00AA | TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 | DHE-PSK-AES128-GCM-SHA256 | [RFC5487] |
|
||||
| 0x00AB | TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 | DHE-PSK-AES256-GCM-SHA384 | [RFC5487] |
|
||||
| 0x00AC | TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 | RSA-PSK-AES128-GCM-SHA256 | [RFC5487] |
|
||||
| 0x00AD | TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 | RSA-PSK-AES256-GCM-SHA384 | [RFC5487] |
|
||||
| 0x00AE | TLS_PSK_WITH_AES_128_CBC_SHA256 | PSK-AES128-CBC-SHA256 | [RFC5487] |
|
||||
| 0x00AF | TLS_PSK_WITH_AES_256_CBC_SHA384 | PSK-AES256-CBC-SHA384 | [RFC5487] |
|
||||
| 0x00B0 | TLS_PSK_WITH_NULL_SHA256 | PSK-NULL-SHA256 | [RFC5487] |
|
||||
| 0x00B1 | TLS_PSK_WITH_NULL_SHA384 | PSK-NULL-SHA384 | [RFC5487] |
|
||||
| 0x00B2 | TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 | DHE-PSK-AES128-CBC-SHA256 | [RFC5487] |
|
||||
| 0x00B3 | TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 | DHE-PSK-AES256-CBC-SHA384 | [RFC5487] |
|
||||
| 0x00B4 | TLS_DHE_PSK_WITH_NULL_SHA256 | DHE-PSK-NULL-SHA256 | [RFC5487] |
|
||||
| 0x00B5 | TLS_DHE_PSK_WITH_NULL_SHA384 | DHE-PSK-NULL-SHA384 | [RFC5487] |
|
||||
| 0x00B6 | TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 | RSA-PSK-AES128-CBC-SHA256 | [RFC5487] |
|
||||
| 0x00B7 | TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 | RSA-PSK-AES256-CBC-SHA384 | [RFC5487] |
|
||||
| 0x00B8 | TLS_RSA_PSK_WITH_NULL_SHA256 | RSA-PSK-NULL-SHA256 | [RFC5487] |
|
||||
| 0x00B9 | TLS_RSA_PSK_WITH_NULL_SHA384 | RSA-PSK-NULL-SHA384 | [RFC5487] |
|
||||
| 0x00BA | TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 | CAMELLIA128-SHA256 | [RFC5932] |
|
||||
| 0x00BD | TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 | DHE-DSS-CAMELLIA128-SHA256 | [RFC5932] |
|
||||
| 0x00BE | TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 | DHE-RSA-CAMELLIA128-SHA256 | [RFC5932] |
|
||||
| 0x00BF | TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 | ADH-CAMELLIA128-SHA256 | [RFC5932] |
|
||||
| 0x00C0 | TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 | CAMELLIA256-SHA256 | [RFC5932] |
|
||||
| 0x00C3 | TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 | DHE-DSS-CAMELLIA256-SHA256 | [RFC5932] |
|
||||
| 0x00C4 | TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 | DHE-RSA-CAMELLIA256-SHA256 | [RFC5932] |
|
||||
| 0x00C5 | TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 | ADH-CAMELLIA256-SHA256 | [RFC5932] |
|
||||
| 0x00FF | TLS_EMPTY_RENEGOTIATION_INFO_SCSV | | [RFC5746] |
|
||||
| 0x5600 | TLS_FALLBACK_SCSV | | [RFC7507] |
|
||||
| 0xC001 | TLS_ECDH_ECDSA_WITH_NULL_SHA | ECDH-ECDSA-NULL-SHA | [RFC8422] |
|
||||
| 0xC002 | TLS_ECDH_ECDSA_WITH_RC4_128_SHA | ECDH-ECDSA-RC4-SHA | [RFC8422][RFC6347] |
|
||||
| 0xC003 | TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA | ECDH-ECDSA-DES-CBC3-SHA | [RFC8422] |
|
||||
| 0xC004 | TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA | ECDH-ECDSA-AES128-SHA | [RFC8422] |
|
||||
| 0xC005 | TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA | ECDH-ECDSA-AES256-SHA | [RFC8422] |
|
||||
| 0xC006 | TLS_ECDHE_ECDSA_WITH_NULL_SHA | ECDHE-ECDSA-NULL-SHA | [RFC8422] |
|
||||
| 0xC007 | TLS_ECDHE_ECDSA_WITH_RC4_128_SHA | ECDHE-ECDSA-RC4-SHA | [RFC8422][RFC6347] |
|
||||
| 0xC008 | TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA | ECDHE-ECDSA-DES-CBC3-SHA | [RFC8422] |
|
||||
| 0xC009 | TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA | ECDHE-ECDSA-AES128-SHA | [RFC8422] |
|
||||
| 0xC00A | TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA | ECDHE-ECDSA-AES256-SHA | [RFC8422] |
|
||||
| 0xC00B | TLS_ECDH_RSA_WITH_NULL_SHA | ECDH-RSA-NULL-SHA | [RFC8422] |
|
||||
| 0xC00C | TLS_ECDH_RSA_WITH_RC4_128_SHA | ECDH-RSA-RC4-SHA | [RFC8422][RFC6347] |
|
||||
| 0xC00D | TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA | ECDH-RSA-DES-CBC3-SHA | [RFC8422] |
|
||||
| 0xC00E | TLS_ECDH_RSA_WITH_AES_128_CBC_SHA | ECDH-RSA-AES128-SHA | [RFC8422] |
|
||||
| 0xC00F | TLS_ECDH_RSA_WITH_AES_256_CBC_SHA | ECDH-RSA-AES256-SHA | [RFC8422] |
|
||||
| 0xC010 | TLS_ECDHE_RSA_WITH_NULL_SHA | ECDHE-RSA-NULL-SHA | [RFC8422] |
|
||||
| 0xC011 | TLS_ECDHE_RSA_WITH_RC4_128_SHA | ECDHE-RSA-RC4-SHA | [RFC8422][RFC6347] |
|
||||
| 0xC012 | TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA | ECDHE-RSA-DES-CBC3-SHA | [RFC8422] |
|
||||
| 0xC013 | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA | ECDHE-RSA-AES128-SHA | [RFC8422] |
|
||||
| 0xC014 | TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA | ECDHE-RSA-AES256-SHA | [RFC8422] |
|
||||
| 0xC015 | TLS_ECDH_anon_WITH_NULL_SHA | AECDH-NULL-SHA | [RFC8422] |
|
||||
| 0xC016 | TLS_ECDH_anon_WITH_RC4_128_SHA | AECDH-RC4-SHA | [RFC8422][RFC6347] |
|
||||
| 0xC017 | TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA | AECDH-DES-CBC3-SHA | [RFC8422] |
|
||||
| 0xC018 | TLS_ECDH_anon_WITH_AES_128_CBC_SHA | AECDH-AES128-SHA | [RFC8422] |
|
||||
| 0xC019 | TLS_ECDH_anon_WITH_AES_256_CBC_SHA | AECDH-AES256-SHA | [RFC8422] |
|
||||
| 0xC01A | TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA | SRP-3DES-EDE-CBC-SHA | [RFC5054] |
|
||||
| 0xC01B | TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA | SRP-RSA-3DES-EDE-CBC-SHA | [RFC5054] |
|
||||
| 0xC01C | TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA | SRP-DSS-3DES-EDE-CBC-SHA | [RFC5054] |
|
||||
| 0xC01D | TLS_SRP_SHA_WITH_AES_128_CBC_SHA | SRP-AES-128-CBC-SHA | [RFC5054] |
|
||||
| 0xC01E | TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA | SRP-RSA-AES-128-CBC-SHA | [RFC5054] |
|
||||
| 0xC01F | TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA | SRP-DSS-AES-128-CBC-SHA | [RFC5054] |
|
||||
| 0xC020 | TLS_SRP_SHA_WITH_AES_256_CBC_SHA | SRP-AES-256-CBC-SHA | [RFC5054] |
|
||||
| 0xC021 | TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA | SRP-RSA-AES-256-CBC-SHA | [RFC5054] |
|
||||
| 0xC022 | TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA | SRP-DSS-AES-256-CBC-SHA | [RFC5054] |
|
||||
| 0xC023 | TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | ECDHE-ECDSA-AES128-SHA256 | [RFC5289] |
|
||||
| 0xC024 | TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 | ECDHE-ECDSA-AES256-SHA384 | [RFC5289] |
|
||||
| 0xC025 | TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 | ECDH-ECDSA-AES128-SHA256 | [RFC5289] |
|
||||
| 0xC026 | TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 | ECDH-ECDSA-AES256-SHA384 | [RFC5289] |
|
||||
| 0xC027 | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 | ECDHE-RSA-AES128-SHA256 | [RFC5289] |
|
||||
| 0xC028 | TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 | ECDHE-RSA-AES256-SHA384 | [RFC5289] |
|
||||
| 0xC029 | TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 | ECDH-RSA-AES128-SHA256 | [RFC5289] |
|
||||
| 0xC02A | TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 | ECDH-RSA-AES256-SHA384 | [RFC5289] |
|
||||
| 0xC02B | TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 | ECDHE-ECDSA-AES128-GCM-SHA256 | [RFC5289] |
|
||||
| 0xC02C | TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 | ECDHE-ECDSA-AES256-GCM-SHA384 | [RFC5289] |
|
||||
| 0xC02D | TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 | ECDH-ECDSA-AES128-GCM-SHA256 | [RFC5289] |
|
||||
| 0xC02E | TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 | ECDH-ECDSA-AES256-GCM-SHA384 | [RFC5289] |
|
||||
| 0xC02F | TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | ECDHE-RSA-AES128-GCM-SHA256 | [RFC5289] |
|
||||
| 0xC030 | TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 | ECDHE-RSA-AES256-GCM-SHA384 | [RFC5289] |
|
||||
| 0xC031 | TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 | ECDH-RSA-AES128-GCM-SHA256 | [RFC5289] |
|
||||
| 0xC032 | TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 | ECDH-RSA-AES256-GCM-SHA384 | [RFC5289] |
|
||||
| 0xC033 | TLS_ECDHE_PSK_WITH_RC4_128_SHA | ECDHE-PSK-RC4-SHA | [RFC5489][RFC6347] |
|
||||
| 0xC034 | TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA | ECDHE-PSK-3DES-EDE-CBC-SHA | [RFC5489] |
|
||||
| 0xC035 | TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA | ECDHE-PSK-AES128-CBC-SHA | [RFC5489] |
|
||||
| 0xC036 | TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA | ECDHE-PSK-AES256-CBC-SHA | [RFC5489] |
|
||||
| 0xC037 | TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 | ECDHE-PSK-AES128-CBC-SHA256 | [RFC5489] |
|
||||
| 0xC038 | TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 | ECDHE-PSK-AES256-CBC-SHA384 | [RFC5489] |
|
||||
| 0xC039 | TLS_ECDHE_PSK_WITH_NULL_SHA | ECDHE-PSK-NULL-SHA | [RFC5489] |
|
||||
| 0xC03A | TLS_ECDHE_PSK_WITH_NULL_SHA256 | ECDHE-PSK-NULL-SHA256 | [RFC5489] |
|
||||
| 0xC03B | TLS_ECDHE_PSK_WITH_NULL_SHA384 | ECDHE-PSK-NULL-SHA384 | [RFC5489] |
|
||||
| 0xC03C | TLS_RSA_WITH_ARIA_128_CBC_SHA256 | ARIA128-SHA256 | [RFC6209] |
|
||||
| 0xC03D | TLS_RSA_WITH_ARIA_256_CBC_SHA384 | ARIA256-SHA384 | [RFC6209] |
|
||||
| 0xC044 | TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 | DHE-RSA-ARIA128-SHA256 | [RFC6209] |
|
||||
| 0xC045 | TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 | DHE-RSA-ARIA256-SHA384 | [RFC6209] |
|
||||
| 0xC048 | TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 | ECDHE-ECDSA-ARIA128-SHA256 | [RFC6209] |
|
||||
| 0xC049 | TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 | ECDHE-ECDSA-ARIA256-SHA384 | [RFC6209] |
|
||||
| 0xC04A | TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 | ECDH-ECDSA-ARIA128-SHA256 | [RFC6209] |
|
||||
| 0xC04B | TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 | ECDH-ECDSA-ARIA256-SHA384 | [RFC6209] |
|
||||
| 0xC04C | TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 | ECDHE-ARIA128-SHA256 | [RFC6209] |
|
||||
| 0xC04D | TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 | ECDHE-ARIA256-SHA384 | [RFC6209] |
|
||||
| 0xC04E | TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 | ECDH-ARIA128-SHA256 | [RFC6209] |
|
||||
| 0xC04F | TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 | ECDH-ARIA256-SHA384 | [RFC6209] |
|
||||
| 0xC050 | TLS_RSA_WITH_ARIA_128_GCM_SHA256 | ARIA128-GCM-SHA256 | [RFC6209] |
|
||||
| 0xC051 | TLS_RSA_WITH_ARIA_256_GCM_SHA384 | ARIA256-GCM-SHA384 | [RFC6209] |
|
||||
| 0xC052 | TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 | DHE-RSA-ARIA128-GCM-SHA256 | [RFC6209] |
|
||||
| 0xC053 | TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 | DHE-RSA-ARIA256-GCM-SHA384 | [RFC6209] |
|
||||
| 0xC056 | TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256 | DHE-DSS-ARIA128-GCM-SHA256 | [RFC6209] |
|
||||
| 0xC057 | TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384 | DHE-DSS-ARIA256-GCM-SHA384 | [RFC6209] |
|
||||
| 0xC05C | TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 | ECDHE-ECDSA-ARIA128-GCM-SHA256 | [RFC6209] |
|
||||
| 0xC05D | TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 | ECDHE-ECDSA-ARIA256-GCM-SHA384 | [RFC6209] |
|
||||
| 0xC05E | TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 | ECDH-ECDSA-ARIA128-GCM-SHA256 | [RFC6209] |
|
||||
| 0xC05F | TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 | ECDH-ECDSA-ARIA256-GCM-SHA384 | [RFC6209] |
|
||||
| 0xC060 | TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 | ECDHE-ARIA128-GCM-SHA256 | [RFC6209] |
|
||||
| 0xC061 | TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 | ECDHE-ARIA256-GCM-SHA384 | [RFC6209] |
|
||||
| 0xC062 | TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 | ECDH-ARIA128-GCM-SHA256 | [RFC6209] |
|
||||
| 0xC063 | TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 | ECDH-ARIA256-GCM-SHA384 | [RFC6209] |
|
||||
| 0xC064 | TLS_PSK_WITH_ARIA_128_CBC_SHA256 | PSK-ARIA128-SHA256 | [RFC6209] |
|
||||
| 0xC065 | TLS_PSK_WITH_ARIA_256_CBC_SHA384 | PSK-ARIA256-SHA384 | [RFC6209] |
|
||||
| 0xC066 | TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 | DHE-PSK-ARIA128-SHA256 | [RFC6209] |
|
||||
| 0xC067 | TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 | DHE-PSK-ARIA256-SHA384 | [RFC6209] |
|
||||
| 0xC068 | TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 | RSA-PSK-ARIA128-SHA256 | [RFC6209] |
|
||||
| 0xC069 | TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 | RSA-PSK-ARIA256-SHA384 | [RFC6209] |
|
||||
| 0xC06A | TLS_PSK_WITH_ARIA_128_GCM_SHA256 | PSK-ARIA128-GCM-SHA256 | [RFC6209] |
|
||||
| 0xC06B | TLS_PSK_WITH_ARIA_256_GCM_SHA384 | PSK-ARIA256-GCM-SHA384 | [RFC6209] |
|
||||
| 0xC06C | TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 | DHE-PSK-ARIA128-GCM-SHA256 | [RFC6209] |
|
||||
| 0xC06D | TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 | DHE-PSK-ARIA256-GCM-SHA384 | [RFC6209] |
|
||||
| 0xC06E | TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 | RSA-PSK-ARIA128-GCM-SHA256 | [RFC6209] |
|
||||
| 0xC06F | TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 | RSA-PSK-ARIA256-GCM-SHA384 | [RFC6209] |
|
||||
| 0xC070 | TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 | ECDHE-PSK-ARIA128-SHA256 | [RFC6209] |
|
||||
| 0xC071 | TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 | ECDHE-PSK-ARIA256-SHA384 | [RFC6209] |
|
||||
| 0xC072 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDHE-ECDSA-CAMELLIA128-SHA256 | [RFC6367] |
|
||||
| 0xC073 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDHE-ECDSA-CAMELLIA256-SHA384 | [RFC6367] |
|
||||
| 0xC074 | TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDH-ECDSA-CAMELLIA128-SHA256 | [RFC6367] |
|
||||
| 0xC075 | TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDH-ECDSA-CAMELLIA256-SHA384 | [RFC6367] |
|
||||
| 0xC076 | TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDHE-RSA-CAMELLIA128-SHA256 | [RFC6367] |
|
||||
| 0xC077 | TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDHE-RSA-CAMELLIA256-SHA384 | [RFC6367] |
|
||||
| 0xC078 | TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDH-CAMELLIA128-SHA256 | [RFC6367] |
|
||||
| 0xC079 | TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDH-CAMELLIA256-SHA384 | [RFC6367] |
|
||||
| 0xC07A | TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 | CAMELLIA128-GCM-SHA256 | [RFC6367] |
|
||||
| 0xC07B | TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 | CAMELLIA256-GCM-SHA384 | [RFC6367] |
|
||||
| 0xC07C | TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 | DHE-RSA-CAMELLIA128-GCM-SHA256 | [RFC6367] |
|
||||
| 0xC07D | TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 | DHE-RSA-CAMELLIA256-GCM-SHA384 | [RFC6367] |
|
||||
| 0xC086 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDHE-ECDSA-CAMELLIA128-GCM-SHA256 | [RFC6367] |
|
||||
| 0xC087 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDHE-ECDSA-CAMELLIA256-GCM-SHA384 | [RFC6367] |
|
||||
| 0xC088 | TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDH-ECDSA-CAMELLIA128-GCM-SHA256 | [RFC6367] |
|
||||
| 0xC089 | TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDH-ECDSA-CAMELLIA256-GCM-SHA384 | [RFC6367] |
|
||||
| 0xC08A | TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDHE-CAMELLIA128-GCM-SHA256 | [RFC6367] |
|
||||
| 0xC08B | TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDHE-CAMELLIA256-GCM-SHA384 | [RFC6367] |
|
||||
| 0xC08C | TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDH-CAMELLIA128-GCM-SHA256 | [RFC6367] |
|
||||
| 0xC08D | TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDH-CAMELLIA256-GCM-SHA384 | [RFC6367] |
|
||||
| 0xC08E | TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 | PSK-CAMELLIA128-GCM-SHA256 | [RFC6367] |
|
||||
| 0xC08F | TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 | PSK-CAMELLIA256-GCM-SHA384 | [RFC6367] |
|
||||
| 0xC090 | TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 | DHE-PSK-CAMELLIA128-GCM-SHA256 | [RFC6367] |
|
||||
| 0xC091 | TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 | DHE-PSK-CAMELLIA256-GCM-SHA384 | [RFC6367] |
|
||||
| 0xC092 | TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 | RSA-PSK-CAMELLIA128-GCM-SHA256 | [RFC6367] |
|
||||
| 0xC093 | TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 | RSA-PSK-CAMELLIA256-GCM-SHA384 | [RFC6367] |
|
||||
| 0xC094 | TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 | PSK-CAMELLIA128-SHA256 | [RFC6367] |
|
||||
| 0xC095 | TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 | PSK-CAMELLIA256-SHA384 | [RFC6367] |
|
||||
| 0xC096 | TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 | DHE-PSK-CAMELLIA128-SHA256 | [RFC6367] |
|
||||
| 0xC097 | TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 | DHE-PSK-CAMELLIA256-SHA384 | [RFC6367] |
|
||||
| 0xC098 | TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 | RSA-PSK-CAMELLIA128-SHA256 | [RFC6367] |
|
||||
| 0xC099 | TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 | RSA-PSK-CAMELLIA256-SHA384 | [RFC6367] |
|
||||
| 0xC09A | TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 | ECDHE-PSK-CAMELLIA128-SHA256 | [RFC6367] |
|
||||
| 0xC09B | TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 | ECDHE-PSK-CAMELLIA256-SHA384 | [RFC6367] |
|
||||
| 0xC09C | TLS_RSA_WITH_AES_128_CCM | AES128-CCM | [RFC6655] |
|
||||
| 0xC09D | TLS_RSA_WITH_AES_256_CCM | AES256-CCM | [RFC6655] |
|
||||
| 0xC09E | TLS_DHE_RSA_WITH_AES_128_CCM | DHE-RSA-AES128-CCM | [RFC6655] |
|
||||
| 0xC09F | TLS_DHE_RSA_WITH_AES_256_CCM | DHE-RSA-AES256-CCM | [RFC6655] |
|
||||
| 0xC0A0 | TLS_RSA_WITH_AES_128_CCM_8 | AES128-CCM8 | [RFC6655] |
|
||||
| 0xC0A1 | TLS_RSA_WITH_AES_256_CCM_8 | AES256-CCM8 | [RFC6655] |
|
||||
| 0xC0A2 | TLS_DHE_RSA_WITH_AES_128_CCM_8 | DHE-RSA-AES128-CCM8 | [RFC6655] |
|
||||
| 0xC0A3 | TLS_DHE_RSA_WITH_AES_256_CCM_8 | DHE-RSA-AES256-CCM8 | [RFC6655] |
|
||||
| 0xC0A4 | TLS_PSK_WITH_AES_128_CCM | PSK-AES128-CCM | [RFC6655] |
|
||||
| 0xC0A5 | TLS_PSK_WITH_AES_256_CCM | PSK-AES256-CCM | [RFC6655] |
|
||||
| 0xC0A6 | TLS_DHE_PSK_WITH_AES_128_CCM | DHE-PSK-AES128-CCM | [RFC6655] |
|
||||
| 0xC0A7 | TLS_DHE_PSK_WITH_AES_256_CCM | DHE-PSK-AES256-CCM | [RFC6655] |
|
||||
| 0xC0A8 | TLS_PSK_WITH_AES_128_CCM_8 | PSK-AES128-CCM8 | [RFC6655] |
|
||||
| 0xC0A9 | TLS_PSK_WITH_AES_256_CCM_8 | PSK-AES256-CCM8 | [RFC6655] |
|
||||
| 0xC0AA | TLS_PSK_DHE_WITH_AES_128_CCM_8 | DHE-PSK-AES128-CCM8 | [RFC6655] |
|
||||
| 0xC0AB | TLS_PSK_DHE_WITH_AES_256_CCM_8 | DHE-PSK-AES256-CCM8 | [RFC6655] |
|
||||
| 0xC0AC | TLS_ECDHE_ECDSA_WITH_AES_128_CCM | ECDHE-ECDSA-AES128-CCM | [RFC7251] |
|
||||
| 0xC0AD | TLS_ECDHE_ECDSA_WITH_AES_256_CCM | ECDHE-ECDSA-AES256-CCM | [RFC7251] |
|
||||
| 0xC0AE | TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 | ECDHE-ECDSA-AES128-CCM8 | [RFC7251] |
|
||||
| 0xC0AF | TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 | ECDHE-ECDSA-AES256-CCM8 | [RFC7251] |
|
||||
| 0xC100 | TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC | GOST2012-KUZNYECHIK-KUZNYECHIKOMAC | [RFC9189] |
|
||||
| 0xC101 | TLS_GOSTR341112_256_WITH_MAGMA_CTR_OMAC | GOST2012-MAGMA-MAGMAOMAC | [RFC9189] |
|
||||
| 0xC102 | TLS_GOSTR341112_256_WITH_28147_CNT_IMIT | IANA-GOST2012-GOST8912-GOST8912 | [RFC9189] |
|
||||
| 0xCC13 | | ECDHE-RSA-CHACHA20-POLY1305-OLD | |
|
||||
| 0xCC14 | | ECDHE-ECDSA-CHACHA20-POLY1305-OLD | |
|
||||
| 0xCC15 | | DHE-RSA-CHACHA20-POLY1305-OLD | |
|
||||
| 0xCCA8 | TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | ECDHE-RSA-CHACHA20-POLY1305 | [RFC7905] |
|
||||
| 0xCCA9 | TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 | ECDHE-ECDSA-CHACHA20-POLY1305 | [RFC7905] |
|
||||
| 0xCCAA | TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | DHE-RSA-CHACHA20-POLY1305 | [RFC7905] |
|
||||
| 0xCCAB | TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 | PSK-CHACHA20-POLY1305 | [RFC7905] |
|
||||
| 0xCCAC | TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 | ECDHE-PSK-CHACHA20-POLY1305 | [RFC7905] |
|
||||
| 0xCCAD | TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 | DHE-PSK-CHACHA20-POLY1305 | [RFC7905] |
|
||||
| 0xCCAE | TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 | RSA-PSK-CHACHA20-POLY1305 | [RFC7905] |
|
||||
| 0xD001 | TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256 | ECDHE-PSK-AES128-GCM-SHA256 | [RFC8442] |
|
||||
| 0xE011 | | ECDHE-ECDSA-SM4-CBC-SM3 | |
|
||||
| 0xE051 | | ECDHE-ECDSA-SM4-GCM-SM3 | |
|
||||
| 0xE052 | | ECDHE-ECDSA-SM4-CCM-SM3 | |
|
||||
| 0xFF00 | | GOST-MD5 | |
|
||||
| 0xFF01 | | GOST-GOST94 | |
|
||||
| 0xFF02 | | GOST-GOST89MAC | |
|
||||
| 0xFF03 | | GOST-GOST89STREAM | |
|
||||
@@ -1,270 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
## curl cipher options
|
||||
|
||||
A TLS handshake involves many parameters which take part in the negotiation
|
||||
between client and server in order to agree on the TLS version and set of
|
||||
algorithms to use for a connection.
|
||||
|
||||
What has become known as a "cipher" or better "cipher suite" in TLS
|
||||
are names for specific combinations of
|
||||
[key exchange](https://en.wikipedia.org/wiki/Key_exchange),
|
||||
[bulk encryption](https://en.wikipedia.org/wiki/Link_encryption),
|
||||
[message authentication code](https://en.wikipedia.org/wiki/Message_authentication_code)
|
||||
and with TLSv1.3 the
|
||||
[authenticated encryption](https://en.wikipedia.org/wiki/Authenticated_encryption).
|
||||
In addition, there are other parameters that influence the TLS handshake, like
|
||||
[DHE](https://en.wikipedia.org/wiki/Diffie%e2%80%93Hellman_key_exchange) "groups"
|
||||
and [ECDHE](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%e2%80%93Hellman)
|
||||
with its "curves".
|
||||
|
||||
### History
|
||||
|
||||
curl's way of letting users configure these settings closely followed OpenSSL
|
||||
in its API. TLS learned new parameters, OpenSSL added new API functions and
|
||||
curl added command line options.
|
||||
|
||||
Several other TLS backends followed the OpenSSL approach, more or less closely,
|
||||
and curl maps the command line options to these TLS backends. Some TLS
|
||||
backends do not support all of it and command line options are either
|
||||
ignored or lead to an error.
|
||||
|
||||
Many examples below show the OpenSSL-like use of these options. GnuTLS
|
||||
however chose a different approach. These are described in a separate
|
||||
section further below.
|
||||
|
||||
## ciphers, the OpenSSL way
|
||||
|
||||
With curl's option
|
||||
[`--tls13-ciphers`](https://curl.se/docs/manpage.html#--tls13-ciphers)
|
||||
or
|
||||
[`CURLOPT_TLS13_CIPHERS`](https://curl.se/libcurl/c/CURLOPT_TLS13_CIPHERS.html)
|
||||
users can control which cipher suites to consider when negotiating TLS 1.3
|
||||
connections. With option
|
||||
[`--ciphers`](https://curl.se/docs/manpage.html#--ciphers)
|
||||
or
|
||||
[`CURLOPT_SSL_CIPHER_LIST`](https://curl.se/libcurl/c/CURLOPT_SSL_CIPHER_LIST.html)
|
||||
users can control which cipher suites to consider when negotiating
|
||||
TLS 1.2 (1.1, 1.0) connections.
|
||||
|
||||
By default, curl may negotiate TLS 1.3 and TLS 1.2 connections, so the cipher
|
||||
suites considered when negotiating a TLS connection are a union of the TLS 1.3
|
||||
and TLS 1.2 cipher suites. If you want curl to consider only TLS 1.3 cipher
|
||||
suites for the connection, you have to set the minimum TLS version to 1.3 by
|
||||
using [`--tlsv1.3`](https://curl.se/docs/manpage.html#--tlsv13)
|
||||
or [`CURLOPT_SSLVERSION`](https://curl.se/libcurl/c/CURLOPT_SSLVERSION.html)
|
||||
with `CURL_SSLVERSION_TLSv1_3`.
|
||||
|
||||
Both the TLS 1.3 and TLS 1.2 cipher options expect a list of cipher suites
|
||||
separated by colons (`:`). This list is parsed opportunistically, cipher suites
|
||||
that are not recognized or implemented are ignored. As long as there is at
|
||||
least one recognized cipher suite in the list, the list is considered valid.
|
||||
|
||||
For both the TLS 1.3 and TLS 1.2 cipher options, the order in which the
|
||||
cipher suites are specified determine the preference of them. When negotiating
|
||||
a TLS connection the server picks a cipher suite from the intersection of the
|
||||
cipher suites supported by the server and the cipher suites sent by curl. If
|
||||
the server is configured to honor the client's cipher preference, the first
|
||||
common cipher suite in the list sent by curl is chosen.
|
||||
|
||||
### TLS 1.3 cipher suites
|
||||
|
||||
Setting TLS 1.3 cipher suites is supported by curl with
|
||||
OpenSSL (1.1.1+, curl 7.61.0+), LibreSSL (3.4.1+, curl 8.3.0+),
|
||||
wolfSSL (curl 8.10.0+) and mbedTLS (3.6.0+, curl 8.10.0+).
|
||||
|
||||
The list of cipher suites that can be used for the `--tls13-ciphers` option:
|
||||
```
|
||||
TLS_AES_128_GCM_SHA256
|
||||
TLS_AES_256_GCM_SHA384
|
||||
TLS_CHACHA20_POLY1305_SHA256
|
||||
TLS_AES_128_CCM_SHA256
|
||||
TLS_AES_128_CCM_8_SHA256
|
||||
```
|
||||
|
||||
#### wolfSSL notes
|
||||
|
||||
In addition to above list the following cipher suites can be used:
|
||||
`TLS_SM4_GCM_SM3` `TLS_SM4_CCM_SM3` `TLS_SHA256_SHA256` `TLS_SHA384_SHA384`.
|
||||
Usage of these cipher suites is not recommended. (The last two cipher suites
|
||||
are NULL ciphers, offering no encryption whatsoever.)
|
||||
|
||||
### TLS 1.2 (1.1, 1.0) cipher suites
|
||||
|
||||
Setting TLS 1.2 cipher suites is supported by curl with OpenSSL, LibreSSL,
|
||||
BoringSSL, mbedTLS (curl 8.8.0+), wolfSSL (curl 7.53.0+). Schannel does not
|
||||
support setting cipher suites directly, but does support setting algorithms
|
||||
(curl 7.61.0+), see Schannel notes below.
|
||||
|
||||
For TLS 1.2 cipher suites there are multiple naming schemes, the two most used
|
||||
are with OpenSSL names (e.g. `ECDHE-RSA-AES128-GCM-SHA256`) and IANA names
|
||||
(e.g. `TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256`). IANA names of TLS 1.2 cipher
|
||||
suites look similar to TLS 1.3 cipher suite names, to distinguish them note
|
||||
that TLS 1.2 names contain `_WITH_`, while TLS 1.3 names do not. When setting
|
||||
TLS 1.2 cipher suites with curl it is recommended that you use OpenSSL names
|
||||
as these are most widely recognized by the supported SSL backends.
|
||||
|
||||
The complete list of cipher suites that may be considered for the `--ciphers`
|
||||
option is extensive, it consists of more than 300 ciphers suites. However,
|
||||
nowadays for most of them their usage is discouraged, and support for a lot of
|
||||
them have been removed from the various SSL backends, if ever implemented at
|
||||
all.
|
||||
|
||||
A shortened list (based on [recommendations by
|
||||
Mozilla](https://wiki.mozilla.org/Security/Server_Side_TLS)) of cipher suites,
|
||||
which are (mostly) supported by all SSL backends, that can be used for the
|
||||
`--ciphers` option:
|
||||
```
|
||||
ECDHE-ECDSA-AES128-GCM-SHA256
|
||||
ECDHE-RSA-AES128-GCM-SHA256
|
||||
ECDHE-ECDSA-AES256-GCM-SHA384
|
||||
ECDHE-RSA-AES256-GCM-SHA384
|
||||
ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
ECDHE-RSA-CHACHA20-POLY1305
|
||||
DHE-RSA-AES128-GCM-SHA256
|
||||
DHE-RSA-AES256-GCM-SHA384
|
||||
DHE-RSA-CHACHA20-POLY1305
|
||||
ECDHE-ECDSA-AES128-SHA256
|
||||
ECDHE-RSA-AES128-SHA256
|
||||
ECDHE-ECDSA-AES128-SHA
|
||||
ECDHE-RSA-AES128-SHA
|
||||
ECDHE-ECDSA-AES256-SHA384
|
||||
ECDHE-RSA-AES256-SHA384
|
||||
ECDHE-ECDSA-AES256-SHA
|
||||
ECDHE-RSA-AES256-SHA
|
||||
DHE-RSA-AES128-SHA256
|
||||
DHE-RSA-AES256-SHA256
|
||||
AES128-GCM-SHA256
|
||||
AES256-GCM-SHA384
|
||||
AES128-SHA256
|
||||
AES256-SHA256
|
||||
AES128-SHA
|
||||
AES256-SHA
|
||||
DES-CBC3-SHA
|
||||
```
|
||||
|
||||
See this [list](https://github.com/curl/curl/blob/master/docs/CIPHERS-TLS12.md)
|
||||
for a complete list of TLS 1.2 cipher suites.
|
||||
|
||||
#### OpenSSL notes
|
||||
|
||||
In addition to specifying a list of cipher suites, OpenSSL also accepts a
|
||||
format with specific cipher strings (like `TLSv1.2`, `AESGCM`, `CHACHA20`) and
|
||||
`!`, `-` and `+` operators. Refer to the
|
||||
[OpenSSL cipher documentation](https://docs.openssl.org/master/man1/openssl-ciphers/#cipher-list-format)
|
||||
for further information on that format.
|
||||
|
||||
#### Schannel notes
|
||||
|
||||
Schannel does not support setting individual TLS 1.2 cipher suites directly.
|
||||
It only allows the enabling and disabling of encryption algorithms. These are
|
||||
in the form of `CALG_xxx`, see the [Schannel `ALG_ID`
|
||||
documentation](https://docs.microsoft.com/windows/desktop/SecCrypto/alg-id)
|
||||
for a list of these algorithms. Also, (since curl 7.77.0)
|
||||
`SCH_USE_STRONG_CRYPTO` can be given to pass that flag to Schannel, lookup the
|
||||
[documentation for the Windows version in
|
||||
use](https://learn.microsoft.com/en-us/windows/win32/secauthn/cipher-suites-in-schannel)
|
||||
to see how that affects the cipher suite selection. When not specifying the
|
||||
`--ciphers` and `--tls13-ciphers` options curl passes this flag by default.
|
||||
|
||||
### Examples
|
||||
|
||||
```sh
|
||||
curl \
|
||||
--tls13-ciphers TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256 \
|
||||
--ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:\
|
||||
ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305 \
|
||||
https://example.com/
|
||||
```
|
||||
Restrict ciphers to `aes128-gcm` and `chacha20`. Works with OpenSSL, LibreSSL,
|
||||
mbedTLS and wolfSSL.
|
||||
|
||||
```sh
|
||||
curl \
|
||||
--tlsv1.3 \
|
||||
--tls13-ciphers TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256 \
|
||||
https://example.com/
|
||||
```
|
||||
Restrict to only TLS 1.3 with `aes128-gcm` and `chacha20` ciphers. Works with
|
||||
OpenSSL, LibreSSL, mbedTLS, wolfSSL and Schannel.
|
||||
|
||||
```sh
|
||||
curl \
|
||||
--ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:\
|
||||
ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305 \
|
||||
https://example.com/
|
||||
```
|
||||
Restrict TLS 1.2 ciphers to `aes128-gcm` and `chacha20`, use default TLS 1.3
|
||||
ciphers (if TLS 1.3 is available). Works with OpenSSL, LibreSSL, BoringSSL,
|
||||
mbedTLS and wolfSSL.
|
||||
|
||||
## ciphers, the GnuTLS way
|
||||
|
||||
With GnuTLS, curl allows configuration of all TLS parameters via option
|
||||
[`--ciphers`](https://curl.se/docs/manpage.html#--ciphers)
|
||||
or
|
||||
[`CURLOPT_SSL_CIPHER_LIST`](https://curl.se/libcurl/c/CURLOPT_SSL_CIPHER_LIST.html)
|
||||
only. The option
|
||||
[`--tls13-ciphers`](https://curl.se/docs/manpage.html#--tls13-ciphers)
|
||||
or
|
||||
[`CURLOPT_TLS13_CIPHERS`](https://curl.se/libcurl/c/CURLOPT_TLS13_CIPHERS.html)
|
||||
is being ignored.
|
||||
|
||||
`--ciphers` is used to set the GnuTLS **priority string** in
|
||||
the following way:
|
||||
|
||||
* When the set string starts with '+', '-' or '!' it is *appended* to the
|
||||
priority string libcurl itself generates (separated by ':'). This initial
|
||||
priority depends other settings such as CURLOPT_SSLVERSION(3),
|
||||
CURLOPT_TLSAUTH_USERNAME(3) (for SRP) or if HTTP/3 (QUIC)
|
||||
is being negotiated.
|
||||
* Otherwise, the set string fully *replaces* the libcurl generated one. While
|
||||
giving full control to the application, the set priority needs to
|
||||
provide for everything the transfer may need to negotiate. Example: if
|
||||
the set priority only allows TLSv1.2, all HTTP/3 attempts fail.
|
||||
|
||||
Users may specify via `--ciphers` anything that GnuTLS supports: ciphers,
|
||||
key exchange, MAC, compression, TLS versions, signature algorithms, groups,
|
||||
elliptic curves, certificate types. In addition, GnuTLS has a variety of
|
||||
other keywords that tweak its operations. Applications or a system
|
||||
may define new alias names for priority strings that can then be used here.
|
||||
|
||||
Since the order of items in priority strings is significant, it makes no
|
||||
sense for curl to puzzle other ssl options somehow together. `--ciphers`
|
||||
is the single way to change priority.
|
||||
|
||||
### Examples
|
||||
|
||||
```sh
|
||||
curl \
|
||||
--ciphers '-CIPHER_ALL:+AES-128-GCM:+CHACHA20-POLY1305' \
|
||||
https://example.com/
|
||||
```
|
||||
Restrict ciphers to `aes128-gcm` and `chacha20` in GnuTLS.
|
||||
|
||||
```sh
|
||||
curl \
|
||||
--ciphers 'NORMAL:-VERS-ALL:+TLS1.3:-AES-256-GCM' \
|
||||
https://example.com/
|
||||
```
|
||||
Restrict to only TLS 1.3 without the `aes256-gcm` cipher.
|
||||
|
||||
```sh
|
||||
curl \
|
||||
--ciphers 'NORMAL:-VERS-ALL:+TLS1.2:-CIPHER_ALL:+CAMELLIA-128-GCM' \
|
||||
https://example.com/
|
||||
```
|
||||
Restrict to only TLS 1.2 with the `CAMELLIA-128-GCM` cipher.
|
||||
|
||||
## Further reading
|
||||
- [OpenSSL cipher suite names documentation](https://docs.openssl.org/master/man1/openssl-ciphers/#cipher-suite-names)
|
||||
- [wolfSSL cipher support documentation](https://www.wolfssl.com/documentation/manuals/wolfssl/chapter04.html#cipher-support)
|
||||
- [mbedTLS cipher suites reference](https://mbed-tls.readthedocs.io/projects/api/en/development/api/file/ssl__ciphersuites_8h/)
|
||||
- [Schannel cipher suites documentation](https://learn.microsoft.com/en-us/windows/win32/secauthn/cipher-suites-in-schannel)
|
||||
- [IANA cipher suites list](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4)
|
||||
- [Wikipedia cipher suite article](https://en.wikipedia.org/wiki/Cipher_suite)
|
||||
- [GnuTLS Priority Strings](https://gnutls.org/manual/html_node/Priority-Strings.html)
|
||||
@@ -1,46 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
if(BUILD_LIBCURL_DOCS)
|
||||
add_subdirectory(libcurl)
|
||||
endif()
|
||||
if(ENABLE_CURL_MANUAL AND BUILD_CURL_EXE)
|
||||
add_subdirectory(cmdline-opts)
|
||||
endif()
|
||||
|
||||
if(BUILD_MISC_DOCS)
|
||||
foreach(_man_misc IN ITEMS "curl-config" "mk-ca-bundle" "wcurl" "runtests" "testcurl")
|
||||
set(_man_target "${CMAKE_CURRENT_BINARY_DIR}/${_man_misc}.1")
|
||||
add_custom_command(OUTPUT "${_man_target}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/cd2nroff" "${_man_misc}.md" > "${_man_target}"
|
||||
DEPENDS "${PROJECT_SOURCE_DIR}/scripts/cd2nroff" "${_man_misc}.md"
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target("curl-generate-${_man_misc}.1" ALL DEPENDS "${_man_target}")
|
||||
if(NOT CURL_DISABLE_INSTALL AND NOT _man_misc STREQUAL "mk-ca-bundle")
|
||||
install(FILES "${_man_target}" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
@@ -1,38 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
Contributor Code of Conduct
|
||||
===========================
|
||||
|
||||
As contributors and maintainers of this project, we pledge to respect all
|
||||
people who contribute through reporting issues, posting feature requests,
|
||||
updating documentation, submitting pull requests or patches, and other
|
||||
activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free
|
||||
experience for everyone, regardless of level of experience, gender, gender
|
||||
identity and expression, sexual orientation, disability, personal appearance,
|
||||
body size, race, ethnicity, age, or religion.
|
||||
|
||||
Examples of unacceptable behavior by participants include the use of sexual
|
||||
language or imagery, derogatory comments or personal attacks, trolling, public
|
||||
or private harassment, insults, or other unprofessional conduct.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct. Project maintainers who do not
|
||||
follow the Code of Conduct may be removed from the project team.
|
||||
|
||||
This code of conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by opening an issue or contacting one or more of the project
|
||||
maintainers.
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor
|
||||
Covenant](https://contributor-covenant.org/), version 1.1.0, available at
|
||||
[https://contributor-covenant.org/version/1/1/0/](https://contributor-covenant.org/version/1/1/0/)
|
||||
@@ -1,175 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# How to do code reviews for curl
|
||||
|
||||
Anyone and everyone is encouraged and welcome to review code submissions in
|
||||
curl. This is a guide on what to check for and how to perform a successful
|
||||
code review.
|
||||
|
||||
## All submissions should get reviewed
|
||||
|
||||
All pull requests and patches submitted to the project should be reviewed by
|
||||
at least one experienced curl maintainer before that code is accepted and
|
||||
merged.
|
||||
|
||||
## Let the tools and tests take the first rounds
|
||||
|
||||
On initial pull requests, let the tools and tests do their job first and then
|
||||
start out by helping the submitter understand the test failures and tool
|
||||
alerts.
|
||||
|
||||
## How to provide feedback to author
|
||||
|
||||
Be nice. Ask questions. Provide examples or suggestions of improvements.
|
||||
Assume the best intentions. Remember language barriers.
|
||||
|
||||
All first-time contributors can become regulars. Let's help them go there.
|
||||
|
||||
## Is this a change we want?
|
||||
|
||||
If this is not a change that seems to be aligned with the project's path
|
||||
forward and as such cannot be accepted, inform the author about this sooner
|
||||
rather than later. Do it gently and explain why and possibly what could be
|
||||
done to make it more acceptable.
|
||||
|
||||
## API/ABI stability or changed behavior
|
||||
|
||||
Changing the API and the ABI may be fine in a change but it needs to be done
|
||||
deliberately and carefully. If not, a reviewer must help the author to realize
|
||||
the mistake.
|
||||
|
||||
curl and libcurl are similarly strict on not modifying existing behavior. API
|
||||
and ABI stability is not enough, the behavior should also remain intact as far
|
||||
as possible.
|
||||
|
||||
## Code style
|
||||
|
||||
Most code style nits are detected by checksrc but not all. Only leave remarks
|
||||
on style deviation once checksrc does not find anymore.
|
||||
|
||||
Minor nits from fresh submitters can also be handled by the maintainer when
|
||||
merging, in case it seems like the submitter is not clear on what to do. We
|
||||
want to make the process fun and exciting for new contributors.
|
||||
|
||||
## Encourage consistency
|
||||
|
||||
Make sure new code is written in a similar style as existing code. Naming,
|
||||
logic, conditions, etc.
|
||||
|
||||
## Are pointers always non-NULL?
|
||||
|
||||
If a function or code rely on pointers being non-NULL, take an extra look if
|
||||
that seems to be a fair assessment.
|
||||
|
||||
## Asserts
|
||||
|
||||
Conditions that should never be false can be verified with `DEBUGASSERT()`
|
||||
calls to get caught in tests and debugging easier, while not having an impact
|
||||
on final or release builds.
|
||||
|
||||
## Memory allocation
|
||||
|
||||
Can the mallocs be avoided? Do not introduce mallocs in any hot paths. If
|
||||
there are (new) mallocs, can they be combined into fewer calls?
|
||||
|
||||
Are all allocations handled in error paths to avoid leaks and crashes?
|
||||
|
||||
## Thread-safety
|
||||
|
||||
We do not like static variables as they break thread-safety and prevent
|
||||
functions from being reentrant.
|
||||
|
||||
## Should features be `#ifdef`ed?
|
||||
|
||||
Features and functionality may not be present everywhere and should therefore
|
||||
be `#ifdef`ed. Additionally, some features should be possible to switch on/off
|
||||
in the build.
|
||||
|
||||
Write `#ifdef`s to be as little of a "maze" as possible.
|
||||
|
||||
## Does it look portable enough?
|
||||
|
||||
curl runs "everywhere". Does the code take a reasonable stance and enough
|
||||
precautions to be possible to build and run on most platforms?
|
||||
|
||||
Remember that we live by C89 restrictions.
|
||||
|
||||
## Tests and testability
|
||||
|
||||
New features should be added in conjunction with one or more test cases.
|
||||
Ideally, functions should also be written so that unit tests can be done to
|
||||
test individual functions.
|
||||
|
||||
## Documentation
|
||||
|
||||
New features or changes to existing functionality **must** be accompanied by
|
||||
updated documentation. Submitting that in a separate follow-up pull request is
|
||||
not OK. A code review must also verify that the submitted documentation update
|
||||
matches the code submission.
|
||||
|
||||
English is not everyone's first language, be mindful of this and help the
|
||||
submitter improve the text if it needs a rewrite to read better.
|
||||
|
||||
## Code should not be hard to understand
|
||||
|
||||
Source code should be written to maximize readability and be easy to
|
||||
understand.
|
||||
|
||||
## Functions should not be large
|
||||
|
||||
A single function should never be large as that makes it hard to follow and
|
||||
understand all the exit points and state changes. Some existing functions in
|
||||
curl certainly violate this ground rule but when reviewing new code we should
|
||||
propose splitting into smaller functions.
|
||||
|
||||
## Duplication is evil
|
||||
|
||||
Anything that looks like duplicated code is a red flag. Anything that seems to
|
||||
introduce code that we *should* already have or provide needs a closer check.
|
||||
|
||||
## Sensitive data
|
||||
|
||||
When credentials are involved, take an extra look at what happens with this
|
||||
data. Where it comes from and where it goes.
|
||||
|
||||
## Variable types differ
|
||||
|
||||
`size_t` is not a fixed size. `time_t` can be signed or unsigned and have
|
||||
different sizes. Relying on variable sizes is a red flag.
|
||||
|
||||
Also remember that endianness and >= 32-bit accesses to unaligned addresses
|
||||
are problematic areas.
|
||||
|
||||
## Integer overflows
|
||||
|
||||
Be careful about integer overflows. Some variable types can be either 32-bit
|
||||
or 64-bit. Integer overflows must be detected and acted on *before* they
|
||||
happen.
|
||||
|
||||
## Dangerous use of functions
|
||||
|
||||
Maybe use of `realloc()` should rather use the dynbuf functions?
|
||||
|
||||
Do not allow new code that grows buffers without using dynbuf.
|
||||
|
||||
Use of C functions that rely on a terminating zero must only be used on data
|
||||
that really do have a null-terminating zero.
|
||||
|
||||
## Dangerous "data styles"
|
||||
|
||||
Make extra precautions and verify that memory buffers that need a terminating
|
||||
zero always have exactly that. Buffers *without* a null-terminator must not be
|
||||
used as input to string functions.
|
||||
|
||||
# Commit messages
|
||||
|
||||
Tightly coupled with a code review is making sure that the commit message is
|
||||
good. It is the responsibility of the person who merges the code to make sure
|
||||
that the commit message follows our standard (detailed in the
|
||||
[CONTRIBUTE](https://curl.se/dev/contribute.html) document). This includes
|
||||
making sure the PR identifies related issues and giving credit to reporters
|
||||
and helpers.
|
||||
@@ -1,367 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Contributing to the curl project
|
||||
|
||||
This document is intended to offer guidelines on how to best contribute to the
|
||||
curl project. This concerns new features as well as corrections to existing
|
||||
flaws or bugs.
|
||||
|
||||
## Join the Community
|
||||
|
||||
Skip over to [https://curl.se/mail/](https://curl.se/mail/) and join
|
||||
the appropriate mailing list(s). Read up on details before you post
|
||||
questions. Read this file before you start sending patches. We prefer
|
||||
questions sent to and discussions being held on the mailing list(s), not sent
|
||||
to individuals.
|
||||
|
||||
Before posting to one of the curl mailing lists, please read up on the
|
||||
[mailing list etiquette](https://curl.se/mail/etiquette.html).
|
||||
|
||||
We also hang out on IRC in #curl on libera.chat
|
||||
|
||||
If you are at all interested in the code side of things, consider clicking
|
||||
'watch' on the [curl repository on GitHub](https://github.com/curl/curl) to be
|
||||
notified of pull requests and new issues posted there.
|
||||
|
||||
## License and copyright
|
||||
|
||||
When contributing with code, you agree to put your changes and new code under
|
||||
the same license curl and libcurl is already using unless stated and agreed
|
||||
otherwise.
|
||||
|
||||
If you add a larger piece of code, you can opt to make that file or set of
|
||||
files to use a different license as long as they do not enforce any changes to
|
||||
the rest of the package and they make sense. Such "separate parts" can not be
|
||||
GPL licensed (as we do not want copyleft to affect users of libcurl) but they
|
||||
must use "GPL compatible" licenses (as we want to allow users to use libcurl
|
||||
properly in GPL licensed environments).
|
||||
|
||||
When changing existing source code, you do not alter the copyright of the
|
||||
original file(s). The copyright is still owned by the original creator(s) or
|
||||
those who have been assigned copyright by the original author(s).
|
||||
|
||||
By submitting a patch to the curl project, you are assumed to have the right
|
||||
to the code and to be allowed by your employer or whatever to hand over that
|
||||
patch/code to us. We credit you for your changes as far as possible, to give
|
||||
credit but also to keep a trace back to who made what changes. Please always
|
||||
provide us with your full real name when contributing,
|
||||
|
||||
## What To Read
|
||||
|
||||
Source code, the man pages, the [INTERNALS
|
||||
document](https://curl.se/dev/internals.html),
|
||||
[TODO](https://curl.se/docs/todo.html),
|
||||
[KNOWN_BUGS](https://curl.se/docs/knownbugs.html) and the [most recent
|
||||
changes](https://curl.se/dev/sourceactivity.html) in git. Just lurking on the
|
||||
[curl-library mailing list](https://curl.se/mail/list.cgi?list=curl-library)
|
||||
gives you a lot of insights on what's going on right now. Asking there is a
|
||||
good idea too.
|
||||
|
||||
## Write a good patch
|
||||
|
||||
### Follow code style
|
||||
|
||||
When writing C code, follow the
|
||||
[CODE_STYLE](https://curl.se/dev/code-style.html) already established in
|
||||
the project. Consistent style makes code easier to read and mistakes less
|
||||
likely to happen. Run `make checksrc` before you submit anything, to make sure
|
||||
you follow the basic style. That script does not verify everything, but if it
|
||||
complains you know you have work to do.
|
||||
|
||||
### Non-clobbering All Over
|
||||
|
||||
When you write new functionality or fix bugs, it is important that you do not
|
||||
fiddle all over the source files and functions. Remember that it is likely
|
||||
that other people have done changes in the same source files as you have and
|
||||
possibly even in the same functions. If you bring completely new
|
||||
functionality, try writing it in a new source file. If you fix bugs, try to
|
||||
fix one bug at a time and send them as separate patches.
|
||||
|
||||
### Write Separate Changes
|
||||
|
||||
It is annoying when you get a huge patch from someone that is said to fix 11
|
||||
odd problems, but discussions and opinions do not agree with 10 of them - or 9
|
||||
of them were already fixed in a different way. Then the person merging this
|
||||
change needs to extract the single interesting patch from somewhere within the
|
||||
huge pile of source, and that creates a lot of extra work.
|
||||
|
||||
Preferably, each fix that corrects a problem should be in its own patch/commit
|
||||
with its own description/commit message stating exactly what they correct so
|
||||
that all changes can be selectively applied by the maintainer or other
|
||||
interested parties.
|
||||
|
||||
Also, separate changes enable bisecting much better for tracking problems
|
||||
and regression in the future.
|
||||
|
||||
### Patch Against Recent Sources
|
||||
|
||||
Please try to get the latest available sources to make your patches against.
|
||||
It makes the lives of the developers so much easier. The best is if you get
|
||||
the most up-to-date sources from the git repository, but the latest release
|
||||
archive is quite OK as well.
|
||||
|
||||
### Documentation
|
||||
|
||||
Writing docs is dead boring and one of the big problems with many open source
|
||||
projects but someone's gotta do it. It makes things a lot easier if you submit
|
||||
a small description of your fix or your new features with every contribution
|
||||
so that it can be swiftly added to the package documentation.
|
||||
|
||||
Documentation is mostly provided as manpages or plain ASCII files. The
|
||||
manpages are rendered from their source files that are usually written using
|
||||
markdown. Most HTML files on the website and in the release archives are
|
||||
generated from corresponding markdown and ASCII files.
|
||||
|
||||
### Test Cases
|
||||
|
||||
Since the introduction of the test suite, we can quickly verify that the main
|
||||
features are working as they are supposed to. To maintain this situation and
|
||||
improve it, all new features and functions that are added need to be tested in
|
||||
the test suite. Every feature that is added should get at least one valid test
|
||||
case that verifies that it works as documented. If every submitter also posts
|
||||
a few test cases, it does not end up a heavy burden on a single person.
|
||||
|
||||
If you do not have test cases or perhaps you have done something that is hard
|
||||
to write tests for, do explain exactly how you have otherwise tested and
|
||||
verified your changes.
|
||||
|
||||
# Submit Your Changes
|
||||
|
||||
## Get your changes merged
|
||||
|
||||
Ideally you file a [pull request on
|
||||
GitHub](https://github.com/curl/curl/pulls), but you can also send your plain
|
||||
patch to [the curl-library mailing
|
||||
list](https://curl.se/mail/list.cgi?list=curl-library).
|
||||
|
||||
If you opt to post a patch on the mailing list, chances are someone converts
|
||||
it into a pull request for you, to have the CI jobs verify it proper before it
|
||||
can be merged. Be prepared that some feedback on the proposed change might
|
||||
then come on GitHub.
|
||||
|
||||
Your changes be reviewed and discussed and you are expected to correct flaws
|
||||
pointed out and update accordingly, or the change risks stalling and
|
||||
eventually just getting deleted without action. As a submitter of a change,
|
||||
you are the owner of that change until it has been merged.
|
||||
|
||||
Respond on the list or on GitHub about the change and answer questions and/or
|
||||
fix nits/flaws. This is important. We take lack of replies as a sign that you
|
||||
are not anxious to get your patch accepted and we tend to simply drop such
|
||||
changes.
|
||||
|
||||
## About pull requests
|
||||
|
||||
With GitHub it is easy to send a [pull
|
||||
request](https://github.com/curl/curl/pulls) to the curl project to have
|
||||
changes merged.
|
||||
|
||||
We strongly prefer pull requests to mailed patches, as it makes it a proper
|
||||
git commit that is easy to merge and they are easy to track and not that easy
|
||||
to lose in the flood of many emails, like they sometimes do on the mailing
|
||||
lists.
|
||||
|
||||
Every pull request submitted is automatically tested in several different
|
||||
ways. [See the CI document for more
|
||||
information](https://github.com/curl/curl/blob/master/docs/tests/CI.md).
|
||||
|
||||
Sometimes the tests fail due to a dependency service temporarily being offline
|
||||
or otherwise unavailable, e.g. package downloads. In this case you can just
|
||||
try to update your pull requests to rerun the tests later as described below.
|
||||
|
||||
You can update your pull requests by pushing new commits or force-pushing
|
||||
changes to existing commits. Force-pushing an amended commit without any
|
||||
actual content changed also allows you to retrigger the tests for that commit.
|
||||
|
||||
When you adjust your pull requests after review, consider squashing the
|
||||
commits so that we can review the full updated version more easily.
|
||||
|
||||
A pull request sent to the project might get labeled `needs-votes` by a
|
||||
project maintainer. This label means that in addition to meeting all other
|
||||
checks and qualifications this pull request must also receive more "votes" of
|
||||
user support. More signs that people want this to happen. It could be in the
|
||||
form of messages saying so, or thumbs-up reactions on GitHub.
|
||||
|
||||
## When the pull request is approved
|
||||
|
||||
If it does not seem to get approved when you think it is ready - feel free to
|
||||
ask for approval.
|
||||
|
||||
Once your pull request has been approved it can be merged by a maintainer.
|
||||
|
||||
For new features, or changes, we require that the *feature window* is open for
|
||||
the pull request to be merged. This is typically a three week period that
|
||||
starts ten days after a previous release. New features submitted as pull
|
||||
requests while the window is closed simply have to wait until it opens to get
|
||||
merged.
|
||||
|
||||
If time passes without your approved pull request gets merged: feel free to
|
||||
ask what more you can do to make it happen.
|
||||
|
||||
## Making quality changes
|
||||
|
||||
Make the patch against as recent source versions as possible.
|
||||
|
||||
If you have followed the tips in this document and your patch still has not
|
||||
been incorporated or responded to after some weeks, consider resubmitting it
|
||||
to the list or better yet: change it to a pull request.
|
||||
|
||||
## Commit messages
|
||||
|
||||
How to write git commit messages in the curl project.
|
||||
|
||||
---- start ----
|
||||
[area]: [short line describing the main effect]
|
||||
-- empty line --
|
||||
[full description, no wider than 72 columns that describes as much as
|
||||
possible as to why this change is made, and possibly what things
|
||||
it fixes and everything else that is related,
|
||||
-- end --
|
||||
|
||||
The first line is a succinct description of the change and should ideally work
|
||||
as a single line in the RELEASE NOTES.
|
||||
|
||||
- use the imperative, present tense: **change** not "changed" nor "changes"
|
||||
- do not capitalize the first letter
|
||||
- no period (.) at the end
|
||||
|
||||
The `[area]` in the first line can be `http2`, `cookies`, `openssl` or
|
||||
similar. There is no fixed list to select from but using the same "area" as
|
||||
other related changes could make sense.
|
||||
|
||||
## Commit message keywords
|
||||
|
||||
Use the following ways to improve the message and provide pointers to related
|
||||
work.
|
||||
|
||||
- `Follow-up to {shorthash}` - if this fixes or continues a previous commit;
|
||||
add a `Ref:` that commit's PR or issue if it is not a small, obvious fix;
|
||||
followed by an empty line
|
||||
|
||||
- `Bug: URL` to the source of the report or more related discussion; use
|
||||
`Fixes` for GitHub issues instead when that is appropriate.
|
||||
|
||||
- `Approved-by: John Doe` - credit someone who approved the PR.
|
||||
|
||||
- `Authored-by: John Doe` - credit the original author of the code; only use
|
||||
this if you cannot use `git commit --author=...`.
|
||||
|
||||
- `Signed-off-by: John Doe` - we do not use this, but do not bother removing
|
||||
it.
|
||||
|
||||
- `whatever-else-by:` credit all helpers, finders, doers; try to use one of
|
||||
the following keywords if at all possible, for consistency: `Acked-by:`,
|
||||
`Assisted-by:`, `Co-authored-by:`, `Found-by:`, `Reported-by:`,
|
||||
`Reviewed-by:`, `Suggested-by:`, `Tested-by:`.
|
||||
|
||||
- `Ref: #1234` - if this is related to a GitHub issue or PR, possibly one that
|
||||
has already been closed.
|
||||
|
||||
- `Ref: URL` to more information about the commit; use `Bug:` instead for a
|
||||
reference to a bug on another bug tracker]
|
||||
|
||||
- `Fixes #1234` - if this fixes a GitHub issue; GitHub closes the issue once
|
||||
this commit is merged.
|
||||
|
||||
- `Closes #1234` - if this merges a GitHub PR; GitHub closes the PR once this
|
||||
commit is merged.
|
||||
|
||||
Do not forget to use commit with `--author` if you commit someone else's work,
|
||||
and make sure that you have your own user and email setup correctly in git
|
||||
before you commit.
|
||||
|
||||
Add whichever header lines as appropriate, with one line per person if more
|
||||
than one person was involved. There is no need to credit yourself unless you
|
||||
are using `--author` which hides your identity. Do not include people's email
|
||||
addresses in headers to avoid spam, unless they are already public from a
|
||||
previous commit; saying `{userid} on github` is OK.
|
||||
|
||||
## Push Access
|
||||
|
||||
If you are a frequent contributor, you may be given push access to the git
|
||||
repository and then you are able to push your changes straight into the git
|
||||
repository instead of sending changes as pull requests or by mail as patches.
|
||||
|
||||
Just ask if this is what you would want. You are required to have posted
|
||||
several high quality patches first, before you can be granted push access.
|
||||
|
||||
## Useful resources
|
||||
- [Webinar on getting code into cURL](https://www.youtube.com/watch?v=QmZ3W1d6LQI)
|
||||
|
||||
# Update copyright and license information
|
||||
|
||||
There is a CI job called **REUSE compliance / check** that runs on every pull
|
||||
request and commit to verify that the *REUSE state* of all files are still
|
||||
fine.
|
||||
|
||||
This means that all files need to have their license and copyright information
|
||||
clearly stated. Ideally by having the standard curl source code header, with
|
||||
the `SPDX-License-Identifier` included. If the header does not work, you can
|
||||
use a smaller header or add the information for a specific file to the
|
||||
`REUSE.toml` file.
|
||||
|
||||
You can manually verify the copyright and compliance status by running the
|
||||
[REUSE helper tool](https://github.com/fsfe/reuse-tool): `reuse lint`
|
||||
|
||||
# On AI use in curl
|
||||
|
||||
Guidelines for AI use when contributing to curl.
|
||||
|
||||
## For security reports and other issues
|
||||
|
||||
If you asked an AI tool to find problems in curl, you **must** make sure to
|
||||
reveal this fact in your report.
|
||||
|
||||
You must also double-check the findings carefully before reporting them to us
|
||||
to validate that the issues are indeed existing and working exactly as the AI
|
||||
says. AI-based tools frequently generate inaccurate or fabricated results.
|
||||
|
||||
Further: it is *rarely* a good idea to just copy and paste an AI generated
|
||||
report to the project. Those generated reports typically are too wordy and
|
||||
rarely to the point (in addition to the common fabricated details). If you
|
||||
actually find a problem with an AI and you have verified it yourself to be
|
||||
true: write the report yourself and explain the problem as you have learned
|
||||
it. This makes sure the AI-generated inaccuracies and invented issues are
|
||||
filtered out early before they waste more people's time.
|
||||
|
||||
As we take security reports seriously, we investigate each report with
|
||||
priority. This work is both time and energy consuming and pulls us away from
|
||||
doing other meaningful work. Fake and otherwise made up security problems
|
||||
effectively prevent us from doing real project work and make us waste time and
|
||||
resources.
|
||||
|
||||
We ban users immediately who submit made up fake reports to the project.
|
||||
|
||||
## For pull requests
|
||||
|
||||
When contributing content to the curl project, you give us permission to use
|
||||
it as-is and you must make sure you are allowed to distribute it to us. By
|
||||
submitting a change to us, you agree that the changes can and should be
|
||||
adopted by curl and get redistributed under the curl license. Authors should
|
||||
be explicitly aware that the burden is on them to ensure no unlicensed code is
|
||||
submitted to the project.
|
||||
|
||||
This is independent if AI is used or not.
|
||||
|
||||
When contributing a pull request you should of course always make sure that
|
||||
the proposal is good quality and a best effort that follows our guidelines. A
|
||||
basic rule of thumb is that if someone can spot that the contribution was made
|
||||
with the help of AI, you have more work to do.
|
||||
|
||||
We can accept code written with the help of AI into the project, but the code
|
||||
must still follow coding standards, be written clearly, be documented, feature
|
||||
test cases and adhere to all the normal requirements we have.
|
||||
|
||||
## For translation
|
||||
|
||||
Translation services help users write reports, texts and documentation in
|
||||
non-native languages and we encourage and welcome such contributors and
|
||||
contributions.
|
||||
|
||||
As AI-based translation tools sometimes have a way to make the output sound a
|
||||
little robotic and add an "AI tone" to the text, you may want to consider
|
||||
mentioning that you used such a tool. Failing to do so risks that maintainers
|
||||
wrongly dismiss translated texts as AI slop.
|
||||
@@ -1,191 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Code defines to disable features and protocols
|
||||
|
||||
## `CURL_DISABLE_ALTSVC`
|
||||
|
||||
Disable support for Alt-Svc: HTTP headers.
|
||||
|
||||
## `CURL_DISABLE_BINDLOCAL`
|
||||
|
||||
Disable support for binding the local end of connections.
|
||||
|
||||
## `CURL_DISABLE_COOKIES`
|
||||
|
||||
Disable support for HTTP cookies.
|
||||
|
||||
## `CURL_DISABLE_BASIC_AUTH`
|
||||
|
||||
Disable support for the Basic authentication methods.
|
||||
|
||||
## `CURL_DISABLE_BEARER_AUTH`
|
||||
|
||||
Disable support for the Bearer authentication methods.
|
||||
|
||||
## `CURL_DISABLE_DIGEST_AUTH`
|
||||
|
||||
Disable support for the Digest authentication methods.
|
||||
|
||||
## `CURL_DISABLE_KERBEROS_AUTH`
|
||||
|
||||
Disable support for the Kerberos authentication methods.
|
||||
|
||||
## `CURL_DISABLE_NEGOTIATE_AUTH`
|
||||
|
||||
Disable support for the negotiate authentication methods.
|
||||
|
||||
## `CURL_DISABLE_AWS`
|
||||
|
||||
Disable **aws-sigv4** support.
|
||||
|
||||
## `CURL_DISABLE_CA_SEARCH`
|
||||
|
||||
Disable unsafe CA bundle search in PATH on Windows.
|
||||
|
||||
## `CURL_DISABLE_DICT`
|
||||
|
||||
Disable the DICT protocol
|
||||
|
||||
## `CURL_DISABLE_DOH`
|
||||
|
||||
Disable DNS-over-HTTPS
|
||||
|
||||
## `CURL_DISABLE_FILE`
|
||||
|
||||
Disable the FILE protocol
|
||||
|
||||
## `CURL_DISABLE_FORM_API`
|
||||
|
||||
Disable the form API
|
||||
|
||||
## `CURL_DISABLE_FTP`
|
||||
|
||||
Disable the FTP (and FTPS) protocol
|
||||
|
||||
## `CURL_DISABLE_GETOPTIONS`
|
||||
|
||||
Disable the `curl_easy_options` API calls that lets users get information
|
||||
about existing options to `curl_easy_setopt`.
|
||||
|
||||
## `CURL_DISABLE_GOPHER`
|
||||
|
||||
Disable the GOPHER protocol.
|
||||
|
||||
## `CURL_DISABLE_HEADERS_API`
|
||||
|
||||
Disable the HTTP header API.
|
||||
|
||||
## `CURL_DISABLE_HSTS`
|
||||
|
||||
Disable the HTTP Strict Transport Security support.
|
||||
|
||||
## `CURL_DISABLE_HTTP`
|
||||
|
||||
Disable the HTTP(S) protocols. Note that this then also disable HTTP proxy
|
||||
support.
|
||||
|
||||
## `CURL_DISABLE_HTTP_AUTH`
|
||||
|
||||
Disable support for all HTTP authentication methods.
|
||||
|
||||
## `CURL_DISABLE_IMAP`
|
||||
|
||||
Disable the IMAP(S) protocols.
|
||||
|
||||
## `CURL_DISABLE_LDAP`
|
||||
|
||||
Disable the LDAP(S) protocols.
|
||||
|
||||
## `CURL_DISABLE_LDAPS`
|
||||
|
||||
Disable the LDAPS protocol.
|
||||
|
||||
## `CURL_DISABLE_LIBCURL_OPTION`
|
||||
|
||||
Disable the --libcurl option from the curl tool.
|
||||
|
||||
## `CURL_DISABLE_MIME`
|
||||
|
||||
Disable MIME support.
|
||||
|
||||
## `CURL_DISABLE_MQTT`
|
||||
|
||||
Disable MQTT support.
|
||||
|
||||
## `CURL_DISABLE_NETRC`
|
||||
|
||||
Disable the netrc parser.
|
||||
|
||||
## `CURL_DISABLE_NTLM`
|
||||
|
||||
Disable support for NTLM.
|
||||
|
||||
## `CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG`
|
||||
|
||||
Disable the auto load config support in the OpenSSL backend.
|
||||
|
||||
## `CURL_DISABLE_PARSEDATE`
|
||||
|
||||
Disable date parsing
|
||||
|
||||
## `CURL_DISABLE_POP3`
|
||||
|
||||
Disable the POP3 protocol
|
||||
|
||||
## `CURL_DISABLE_PROGRESS_METER`
|
||||
|
||||
Disable the built-in progress meter
|
||||
|
||||
## `CURL_DISABLE_PROXY`
|
||||
|
||||
Disable support for proxies
|
||||
|
||||
## `CURL_DISABLE_IPFS`
|
||||
|
||||
Disable the IPFS/IPNS protocols. This affects the curl tool only, where
|
||||
IPFS/IPNS protocol support is implemented.
|
||||
|
||||
## `CURL_DISABLE_RTSP`
|
||||
|
||||
Disable the RTSP protocol.
|
||||
|
||||
## `CURL_DISABLE_SHA512_256`
|
||||
|
||||
Disable the SHA-512/256 hash algorithm.
|
||||
|
||||
## `CURL_DISABLE_SHUFFLE_DNS`
|
||||
|
||||
Disable the shuffle DNS feature
|
||||
|
||||
## `CURL_DISABLE_SMB`
|
||||
|
||||
Disable the SMB(S) protocols
|
||||
|
||||
## `CURL_DISABLE_SMTP`
|
||||
|
||||
Disable the SMTP(S) protocols
|
||||
|
||||
## `CURL_DISABLE_SOCKETPAIR`
|
||||
|
||||
Disable the use of `socketpair()` internally to allow waking up and canceling
|
||||
`curl_multi_poll()`.
|
||||
|
||||
## `CURL_DISABLE_TELNET`
|
||||
|
||||
Disable the TELNET protocol
|
||||
|
||||
## `CURL_DISABLE_TFTP`
|
||||
|
||||
Disable the TFTP protocol
|
||||
|
||||
## `CURL_DISABLE_VERBOSE_STRINGS`
|
||||
|
||||
Disable verbose strings and error messages.
|
||||
|
||||
## `CURL_DISABLE_WEBSOCKETS`
|
||||
|
||||
Disable the WebSocket protocols.
|
||||
@@ -1,166 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# curldown
|
||||
|
||||
A markdown-like syntax for libcurl man pages.
|
||||
|
||||
## Purpose
|
||||
|
||||
A text format for writing libcurl documentation in the shape of man pages.
|
||||
|
||||
Make it easier for users to contribute and write documentation. A format that
|
||||
is easier on the eye in its source format.
|
||||
|
||||
Make it harder to do syntactical mistakes.
|
||||
|
||||
Use a format that allows creating man pages that end up looking exactly like
|
||||
the man pages did when we wrote them in nroff format.
|
||||
|
||||
Take advantage of the fact that people these days are accustomed to markdown
|
||||
by using a markdown-like syntax.
|
||||
|
||||
This allows us to fix issues in the nroff format easier since now we generate
|
||||
them. For example: escaping minus to prevent them from being turned into
|
||||
Unicode by man.
|
||||
|
||||
Generate nroff output that looks (next to) *identical* to the previous files,
|
||||
so that the look, existing test cases, HTML conversions, existing
|
||||
infrastructure etc remain mostly intact.
|
||||
|
||||
Contains meta-data in a structured way to allow better output (for example the
|
||||
see also information) and general awareness of what the file is about.
|
||||
|
||||
## File extension
|
||||
|
||||
Since curldown looks similar to markdown, we use `.md` extensions on the
|
||||
files.
|
||||
|
||||
## Conversion
|
||||
|
||||
Convert **from curldown to nroff** with `cd2nroff`. Generates nroff man pages.
|
||||
|
||||
Convert **from nroff to curldown** with `nroff2cd`. This is only meant to be
|
||||
used for the initial conversion to curldown and should ideally never be needed
|
||||
again.
|
||||
|
||||
Convert, check or clean up an existing curldown to nicer, better, cleaner
|
||||
curldown with **cd2cd**.
|
||||
|
||||
Mass-convert all curldown files to nroff in specified directories with
|
||||
`cdall`:
|
||||
|
||||
cdall [dir1] [dir2] [dir3] ..
|
||||
|
||||
## Known issues
|
||||
|
||||
The `cd2nroff` tool does not yet handle *italics* or **bold** where the start
|
||||
and the end markers are used on separate lines.
|
||||
|
||||
The `nroff2cd` tool generates code style quotes for all `.fi` sections since
|
||||
the nroff format does not carry a distinction.
|
||||
|
||||
# Format
|
||||
|
||||
Each curldown starts with a header with meta-data:
|
||||
|
||||
---
|
||||
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
SPDX-License-Identifier: curl
|
||||
Title: CURLOPT_AWS_SIGV4
|
||||
Section: 3
|
||||
Source: libcurl
|
||||
Protocol:
|
||||
- HTTP
|
||||
See-also:
|
||||
- CURLOPT_HEADEROPT (3)
|
||||
- CURLOPT_HTTPAUTH (3)
|
||||
TLS-backend:
|
||||
- [name]
|
||||
Added-in: [version or "n/a"]
|
||||
---
|
||||
|
||||
All curldown files *must* have all the headers present and at least one
|
||||
`See-also:` entry specified.
|
||||
|
||||
If the man page is for section 3 (library related). The `Protocol` list must
|
||||
contain at least one protocol, which can be `*` if the option is virtually for
|
||||
everything. If `*` is used, it must be the only listed protocol. Recognized
|
||||
protocols are either URL schemes (in uppercase), `TLS` or `TCP`.
|
||||
|
||||
If the `Protocol` list contains `TLS`, then there must also be a `TLS-backend`
|
||||
list, specifying `All` or a list of what TLS backends that work with this
|
||||
option. The available TLS backends are:
|
||||
|
||||
- `GnuTLS`
|
||||
- `mbedTLS`
|
||||
- `OpenSSL` (also covers BoringSSL, LibreSSL, quictls, AWS-LC and AmiSSL)
|
||||
- `rustls`
|
||||
- `Schannel`
|
||||
- `wolfSSL`
|
||||
- `All`: all TLS backends
|
||||
|
||||
Following the header in the file, is the manual page using markdown-like
|
||||
syntax:
|
||||
|
||||
~~~
|
||||
# NAME
|
||||
a page - this is a page describing something
|
||||
|
||||
# SYNOPSIS
|
||||
~~~c
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_AWS_SIGV4, char *param);
|
||||
~~~
|
||||
~~~
|
||||
|
||||
Quoted source code should start with `~~~c` and end with `~~~` while regular
|
||||
quotes can start with `~~~` or just be indented with 4 spaces.
|
||||
|
||||
Headers at top-level `#` get converted to `.SH`.
|
||||
|
||||
`nroff2cd` supports the `##` next level header which gets converted to `.IP`.
|
||||
|
||||
Write bold words or phrases within `**` like:
|
||||
|
||||
This is a **bold** word.
|
||||
|
||||
Write italics like:
|
||||
|
||||
This is *italics*.
|
||||
|
||||
Due to how man pages do not support backticks especially formatted, such
|
||||
occurrences in the source are instead just using italics in the generated
|
||||
output:
|
||||
|
||||
This `word` appears in italics.
|
||||
|
||||
When generating the nroff output, the tooling removes superfluous newlines,
|
||||
meaning they can be used freely in the source file to make the text more
|
||||
readable.
|
||||
|
||||
To make sure curldown documents render correctly as markdown, all literal
|
||||
occurrences of `<` or `>` need to be escaped by a leading backslash.
|
||||
|
||||
## Generating contents
|
||||
|
||||
`# %PROTOCOLS%` - inserts a **PROTOCOLS** section based on the metadata
|
||||
provided in the header.
|
||||
|
||||
`# %AVAILABILITY%` - inserts an **AVAILABILITY** section based on the metadata
|
||||
provided in the header.
|
||||
|
||||
## Symbols
|
||||
|
||||
All mentioned curl symbols that have their own man pages, like
|
||||
`curl_easy_perform(3)` are automatically rendered using italics in the output
|
||||
without having to enclose it with asterisks. This helps ensuring that they get
|
||||
converted to links properly later in the HTML version on the website, as
|
||||
converted with `roffit`. This makes the curldown text easier to read even when
|
||||
mentioning many curl symbols.
|
||||
|
||||
This auto-linking works for patterns matching `(lib|)curl[^ ]*(3)`.
|
||||
@@ -1,73 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Items to be removed from future curl releases
|
||||
|
||||
If any of these deprecated features is a cause for concern for you, please
|
||||
email the
|
||||
[curl-library mailing list](https://lists.haxx.se/listinfo/curl-library)
|
||||
as soon as possible and explain to us why this is a problem for you and
|
||||
how your use case cannot be satisfied properly using a workaround.
|
||||
|
||||
## Nothing
|
||||
|
||||
Nothing is currently scheduled to be removed.
|
||||
|
||||
## msh3 support
|
||||
|
||||
The msh3 backed for QUIC and HTTP/3 was introduced in April 2022 but has never
|
||||
been made to work properly. It has seen no visible traction or developer
|
||||
activity from the msh3 main author (or anyone else seemingly interested) in
|
||||
two years. As a non-functional backend, it only adds friction and "weight" to
|
||||
the development and maintenance.
|
||||
|
||||
Meanwhile, we have a fully working backend in the ngtcp2 one and we have two
|
||||
fully working backends in OpenSSL-QUIC and quiche well on their way of ending
|
||||
their experimental status in a future.
|
||||
|
||||
We remove msh3 support from the curl source tree in July 2025.
|
||||
|
||||
## winbuild build system
|
||||
|
||||
curl drops support for the winbuild build method after September 2025.
|
||||
|
||||
We recommend migrating to CMake. See the migration guide in
|
||||
`docs/INSTALL-CMAKE.md`.
|
||||
|
||||
## Windows CE
|
||||
|
||||
Windows CE "mainstream support" ended on October 9, 2018, and "Extended
|
||||
Support" ended on October 10, 2023.
|
||||
|
||||
curl drops all support in November 2025.
|
||||
|
||||
## VS2008
|
||||
|
||||
curl drops support for getting built with Microsoft Visual Studio 2008 in
|
||||
November 2025.
|
||||
|
||||
The only reason we kept support for this version is for Windows CE - and we
|
||||
intend to remove support for that Operating System in this time frame as well.
|
||||
Bumping the minimum to VS2010. VS2008 is a pain to support.
|
||||
|
||||
Previous discussion and details: https://github.com/curl/curl/discussions/15972
|
||||
|
||||
## Past removals
|
||||
|
||||
- axTLS (removed in 7.63.0)
|
||||
- Pipelining (removed in 7.65.0)
|
||||
- PolarSSL (removed in 7.69.0)
|
||||
- NPN (removed in 7.86.0)
|
||||
- Support for systems without 64-bit data types (removed in 8.0.0)
|
||||
- NSS (removed in 8.3.0)
|
||||
- gskit (removed in 8.3.0)
|
||||
- MinGW v1 (removed in 8.4.0)
|
||||
- NTLM_WB (removed in 8.8.0)
|
||||
- space-separated `NOPROXY` patterns (removed in 8.9.0)
|
||||
- hyper (removed in 8.12.0)
|
||||
- Support for Visual Studio 2005 and older (removed in 8.13.0)
|
||||
- Secure Transport (removed in 8.15.0)
|
||||
- BearSSL (removed in 8.15.0)
|
||||
@@ -1,286 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# curl distros
|
||||
|
||||
<!-- markdown-link-check-disable -->
|
||||
|
||||
Lots of organizations distribute curl packages to end users. This is a
|
||||
collection of pointers to where to learn more about curl on and with each
|
||||
distro. Those marked *Rolling Release* typically run the latest version of curl
|
||||
and are therefore less likely to have back-ported patches to older versions.
|
||||
|
||||
We discuss curl distro issues, patches and collaboration on the [curl-distros
|
||||
mailing list](https://lists.haxx.se/listinfo/curl-distros) ([list
|
||||
archives](https://curl.se/mail/list.cgi?list=curl-distros)).
|
||||
|
||||
## AlmaLinux
|
||||
|
||||
- curl package source and patches: https://git.almalinux.org/rpms/curl/
|
||||
- curl issues: https://bugs.almalinux.org/view_all_bug_page.php click Category and choose curl
|
||||
- curl security: https://errata.almalinux.org/ search for curl
|
||||
|
||||
## Alpine Linux
|
||||
|
||||
- curl: https://pkgs.alpinelinux.org/package/edge/main/x86_64/curl
|
||||
- curl issues: https://gitlab.alpinelinux.org/alpine/aports/-/issues
|
||||
- curl security: https://security.alpinelinux.org/srcpkg/curl
|
||||
- curl package source and patches: https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/main/curl
|
||||
|
||||
## Alt Linux
|
||||
|
||||
- curl: https://packages.altlinux.org/en/search/?q=curl
|
||||
- curl issues: https://packages.altlinux.org/en/sisyphus/srpms/curl/issues/
|
||||
- curl patches: https://git.altlinux.org/gears/c/curl.git?p=curl.git;a=tree;f=.gear
|
||||
|
||||
## Arch Linux
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://archlinux.org/packages/core/x86_64/curl/
|
||||
- curl issues: https://gitlab.archlinux.org/archlinux/packaging/packages/curl/-/issues
|
||||
- curl security: https://security.archlinux.org/package/curl
|
||||
- curl wiki: https://wiki.archlinux.org/title/CURL
|
||||
|
||||
## Buildroot
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl package source and patches: https://git.buildroot.net/buildroot/tree/package/libcurl
|
||||
- curl issues: https://bugs.buildroot.org/buglist.cgi?quicksearch=curl
|
||||
|
||||
## Chimera
|
||||
|
||||
- curl package source and patches: https://github.com/chimera-linux/cports/tree/master/main/curl
|
||||
|
||||
## Clear Linux
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://github.com/clearlinux-pkgs/curl
|
||||
- curl issues: https://github.com/clearlinux/distribution/issues
|
||||
|
||||
## Conary
|
||||
|
||||
- curl: https://github.com/conan-io/conan-center-index/tree/master/recipes/libcurl
|
||||
- curl issues: https://github.com/conan-io/conan-center-index/issues
|
||||
- curl patches: https://github.com/conan-io/conan-center-index/tree/master/recipes/libcurl (in `all/patches/*`, if any)
|
||||
|
||||
## conda-forge
|
||||
|
||||
- curl: https://github.com/conda-forge/curl-feedstock
|
||||
- curl issues: https://github.com/conda-forge/curl-feedstock/issues
|
||||
|
||||
## CRUX
|
||||
|
||||
- curl: https://crux.nu/portdb/?a=search&q=curl
|
||||
- curl issues: https://git.crux.nu/ports/core/issues/?type=all&state=open&q=curl
|
||||
|
||||
## curl-for-win
|
||||
|
||||
(this is the official curl binaries for Windows shipped by the curl project)
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://curl.se/windows/
|
||||
- curl patches: https://github.com/curl/curl-for-win/blob/main/curl.patch (if any)
|
||||
- build-specific issues: https://github.com/curl/curl-for-win/issues
|
||||
|
||||
Issues and patches for this are managed in the main curl project.
|
||||
|
||||
## Cygwin
|
||||
|
||||
- curl: https://cygwin.com/cgit/cygwin-packages/curl/tree/curl.cygport
|
||||
- curl patches: https://cygwin.com/cgit/cygwin-packages/curl/tree
|
||||
- curl issues: https://inbox.sourceware.org/cygwin/?q=s%3Acurl
|
||||
|
||||
## Cygwin (cross mingw64)
|
||||
|
||||
- mingw64-x86_64-curl: https://cygwin.com/cgit/cygwin-packages/mingw64-x86_64-curl/tree/mingw64-x86_64-curl.cygport
|
||||
- mingw64-x86_64-curl patches: https://cygwin.com/cgit/cygwin-packages/mingw64-x86_64-curl/tree
|
||||
- mingw64-x86_64-curl issues: https://inbox.sourceware.org/cygwin/?q=s%3Amingw64-x86_64-curl
|
||||
|
||||
## Debian
|
||||
|
||||
- curl: https://tracker.debian.org/pkg/curl
|
||||
- curl issues: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=curl
|
||||
- curl patches: https://udd.debian.org/patches.cgi?src=curl
|
||||
- curl patches: https://salsa.debian.org/debian/curl (in debian/* branches, inside the folder debian/patches)
|
||||
|
||||
## Fedora
|
||||
|
||||
- curl: https://src.fedoraproject.org/rpms/curl
|
||||
- curl issues: [bugzilla](https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&classification=Fedora&product=Fedora&product=Fedora%20EPEL&component=curl)
|
||||
- curl patches: [list of patches in package git](https://src.fedoraproject.org/rpms/curl/tree/rawhide)
|
||||
|
||||
## FreeBSD
|
||||
|
||||
- curl: https://cgit.freebsd.org/ports/tree/ftp/curl
|
||||
- curl patches: https://cgit.freebsd.org/ports/tree/ftp/curl
|
||||
- curl issues: https://bugs.freebsd.org/bugzilla/buglist.cgi?bug_status=__open__&order=Importance&product=Ports%20%26%20Packages&query_format=advanced&short_desc=curl&short_desc_type=allwordssubstr
|
||||
|
||||
## Gentoo Linux
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://packages.gentoo.org/packages/net-misc/curl
|
||||
- curl issues: https://bugs.gentoo.org/buglist.cgi?quicksearch=net-misc/curl
|
||||
- curl package sources and patches: https://gitweb.gentoo.org/repo/gentoo.git/tree/net-misc/curl/
|
||||
|
||||
## GNU Guix
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://git.savannah.gnu.org/gitweb/?p=guix.git;a=blob;f=gnu/packages/curl.scm;hb=HEAD
|
||||
- curl issues: https://issues.guix.gnu.org/search?query=curl
|
||||
|
||||
## Homebrew
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://formulae.brew.sh/formula/curl
|
||||
|
||||
Homebrew's policy is that all patches and issues should be submitted upstream
|
||||
unless it is specific to Homebrew's way of packaging software.
|
||||
|
||||
## MacPorts
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://github.com/macports/macports-ports/tree/master/net/curl
|
||||
- curl issues: https://trac.macports.org/query?0_port=curl&0_port_mode=%7E&0_status=%21closed
|
||||
- curl patches: https://github.com/macports/macports-ports/tree/master/net/curl/files
|
||||
|
||||
## Mageia
|
||||
|
||||
- curl: https://svnweb.mageia.org/packages/cauldron/curl/current/SPECS/curl.spec?view=markup
|
||||
- curl issues: https://bugs.mageia.org/buglist.cgi?bug_status=NEW&bug_status=UNCONFIRMED&bug_status=NEEDINFO&bug_status=UPSTREAM&bug_status=ASSIGNED&component=RPM%20Packages&f1=cf_rpmpkg&list_id=176576&o1=casesubstring&product=Mageia&query_format=advanced&v1=curl
|
||||
- curl patches: https://svnweb.mageia.org/packages/cauldron/curl/current/SOURCES/
|
||||
- curl patches in stable distro releases: https://svnweb.mageia.org/packages/updates/<STABLE_VERSION>/curl/current/SOURCES/
|
||||
- curl security: https://advisories.mageia.org/src_curl.html
|
||||
|
||||
## MSYS2
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://github.com/msys2/MSYS2-packages/tree/master/curl
|
||||
- curl issues: https://github.com/msys2/MSYS2-packages/issues
|
||||
- curl patches: https://github.com/msys2/MSYS2-packages/tree/master/curl (`*.patch`)
|
||||
|
||||
## MSYS2 (mingw-w64)
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-curl
|
||||
- curl issues: https://github.com/msys2/MINGW-packages/issues
|
||||
- curl patches: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-curl (`*.patch`)
|
||||
|
||||
## Muldersoft
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://github.com/lordmulder/cURL-build-win32
|
||||
- curl issues: https://github.com/lordmulder/cURL-build-win32/issues
|
||||
- curl patches: https://github.com/lordmulder/cURL-build-win32/tree/master/patch
|
||||
|
||||
## NixOS
|
||||
|
||||
- curl: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/cu/curlMinimal/package.nix
|
||||
- curl issues: https://github.com/NixOS/nixpkgs
|
||||
|
||||
nixpkgs is the package repository used by the NixOS Linux distribution, but
|
||||
can also be used on other distributions
|
||||
|
||||
## OmniOS
|
||||
|
||||
- curl: https://github.com/omniosorg/omnios-build/tree/master/build/curl
|
||||
- curl issues: https://github.com/omniosorg/omnios-build/issues
|
||||
- curl patches: https://github.com/omniosorg/omnios-build/tree/master/build/curl/patches
|
||||
|
||||
## OpenIndiana
|
||||
|
||||
- curl: https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/web/curl
|
||||
- curl issues: https://www.illumos.org/projects/openindiana/issues
|
||||
- curl patches: https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/web/curl/patches
|
||||
|
||||
## OpenSUSE
|
||||
|
||||
- curl source and patches: https://build.opensuse.org/package/show/openSUSE%3AFactory/curl
|
||||
|
||||
## Oracle Solaris
|
||||
|
||||
- curl: https://github.com/oracle/solaris-userland/tree/master/components/curl
|
||||
- curl issues: https://support.oracle.com/ (requires support contract)
|
||||
- curl patches: https://github.com/oracle/solaris-userland/tree/master/components/curl/patches
|
||||
|
||||
## OpenEmbedded / Yocto Project
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://layers.openembedded.org/layerindex/recipe/5765/
|
||||
- curl issues: https://bugzilla.yoctoproject.org/
|
||||
- curl patches: https://git.openembedded.org/openembedded-core/tree/meta/recipes-support/curl
|
||||
|
||||
## PLD Linux
|
||||
|
||||
- curl package source and patches: https://github.com/pld-linux/curl
|
||||
- curl issues: https://bugs.launchpad.net/pld-linux?field.searchtext=curl&search=Search&field.status%3Alist=NEW&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&field.status%3Alist=INPROGRESS&field.status%3Alist=FIXCOMMITTED&field.assignee=&field.bug_reporter=&field.omit_dupes=on&field.has_patch=&field.has_no_package=
|
||||
|
||||
## pkgsrc
|
||||
|
||||
- curl: https://github.com/NetBSD/pkgsrc/tree/trunk/www/curl
|
||||
- curl issues: https://github.com/NetBSD/pkgsrc/issues
|
||||
- curl patches: https://github.com/NetBSD/pkgsrc/tree/trunk/www/curl/patches
|
||||
|
||||
## Red Hat Enterprise Linux / CentOS Stream
|
||||
|
||||
- curl: https://kojihub.stream.centos.org/koji/packageinfo?packageID=217
|
||||
- curl issues: https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12332745&issuetype=1&components=12377466&priority=10300
|
||||
- curl patches: https://gitlab.com/redhat/centos-stream/rpms/curl
|
||||
|
||||
## Rocky Linux
|
||||
|
||||
- curl: https://git.rockylinux.org/staging/rpms/curl/-/blob/r9/SPECS/curl.spec
|
||||
- curl issues: https://bugs.rockylinux.org
|
||||
- curl patches: https://git.rockylinux.org/staging/rpms/curl/-/tree/r9/SOURCES
|
||||
|
||||
## SerenityOS
|
||||
|
||||
- curl: https://github.com/SerenityOS/serenity/tree/master/Ports/curl
|
||||
- curl issues: https://github.com/SerenityOS/serenity/issues?q=label%3Aports
|
||||
- curl patches: https://github.com/SerenityOS/serenity/tree/master/Ports/curl/patches
|
||||
|
||||
## SmartOS
|
||||
|
||||
- curl: https://github.com/TritonDataCenter/illumos-extra/tree/master/curl
|
||||
- curl issues: https://github.com/TritonDataCenter/illumos-extra/issues
|
||||
- curl patches: https://github.com/TritonDataCenter/illumos-extra/tree/master/curl/Patches
|
||||
|
||||
## SPACK
|
||||
|
||||
- curl package source and patches: https://github.com/spack/spack/tree/develop/var/spack/repos/builtin/packages/curl
|
||||
|
||||
## vcpkg
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://github.com/microsoft/vcpkg/tree/master/ports/curl
|
||||
- curl issues: https://github.com/microsoft/vcpkg/issues
|
||||
- curl patches: https://github.com/microsoft/vcpkg/tree/master/ports/curl (`*.patch`)
|
||||
|
||||
## Void Linux
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://github.com/void-linux/void-packages/tree/master/srcpkgs/curl
|
||||
- curl issues: https://github.com/void-linux/void-packages/issues
|
||||
- curl patches: https://github.com/void-linux/void-packages/tree/master/srcpkgs/curl/patches
|
||||
|
||||
## Wolfi
|
||||
|
||||
*Rolling Release*
|
||||
|
||||
- curl: https://github.com/wolfi-dev/os/blob/main/curl.yaml
|
||||
@@ -1,73 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# How to determine if an early patch release is warranted
|
||||
|
||||
In the curl project we do releases every 8 weeks. Unless we break the cycle
|
||||
and do an early patch release.
|
||||
|
||||
We do frequent releases partly to always have the next release "not too far
|
||||
away".
|
||||
|
||||
## Bugfix
|
||||
|
||||
During the release cycle, and especially in the beginning of a new cycle (the
|
||||
so-called "cool down" period), there are times when a bug is reported and
|
||||
after it has been subsequently fixed correctly, the question might be asked:
|
||||
is this bug and associated fix important enough for an early patch release?
|
||||
|
||||
The question can only be properly asked when a fix has been created and landed
|
||||
in the git master branch.
|
||||
|
||||
## Early release
|
||||
|
||||
An early patch release means that we ship a new, complete and full release
|
||||
called `major.minor.patch` where the `patch` part is increased by one since
|
||||
the previous release. A curl release is a curl release. There is no small or
|
||||
big and we never release just a patch. There is only "release".
|
||||
|
||||
## Questions to ask
|
||||
|
||||
- Is there a security advisory rated high or critical?
|
||||
- Is there a data corruption bug?
|
||||
- Did the bug cause an API/ABI breakage?
|
||||
- Does the problem annoy a significant share of the user population?
|
||||
|
||||
If the answer is yes to one or more of the above, an early release might be
|
||||
warranted.
|
||||
|
||||
More questions to ask ourselves when doing the assessment if the answers to
|
||||
the three ones above are all 'no'.
|
||||
|
||||
- Does the bug cause curl to prematurely terminate?
|
||||
- How common is the affected buggy option/feature/protocol/platform to get
|
||||
used?
|
||||
- How large is the estimated impacted user base?
|
||||
- Does the bug block something crucial for applications or other adoption of
|
||||
curl "out there" ?
|
||||
- Does the bug cause problems for curl developers or others on "the curl
|
||||
team" ?
|
||||
- Is the bug limited to the curl tool only? That might have a smaller impact
|
||||
than a bug also present in libcurl.
|
||||
- Is there a (decent) workaround?
|
||||
- Is it a regression? Is the bug introduced in this release?
|
||||
- Can the bug be fixed "easily" by applying a patch?
|
||||
- Does the bug break the build? Most users do not build curl themselves.
|
||||
- How long is it until the already scheduled next release?
|
||||
- Can affected users safely rather revert to a former release until the next
|
||||
scheduled release?
|
||||
- Is it a performance regression with no functionality side-effects? If so it
|
||||
has to be substantial.
|
||||
|
||||
## If an early release is deemed necessary
|
||||
|
||||
Unless done for security or similarly important reasons, an early release
|
||||
should not be done within a week of the previous release.
|
||||
|
||||
This, to enable us to collect and bundle more fixes into the same release to
|
||||
make the release more worthwhile for everyone and to allow more time for fixes
|
||||
to settle and things to get tested. Getting a release in shape and done in
|
||||
style is work that should not be rushed.
|
||||
@@ -1,496 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Building curl with HTTPS-RR and ECH support
|
||||
|
||||
We have added support for ECH to curl. It can use HTTPS RRs published in the
|
||||
DNS if curl uses DoH, or else can accept the relevant ECHConfigList values
|
||||
from the command line. This works with OpenSSL, wolfSSL, BoringSSL, AWS-LC
|
||||
or rustls-ffi as the TLS provider.
|
||||
|
||||
This feature is EXPERIMENTAL. DO NOT USE IN PRODUCTION.
|
||||
|
||||
This should however provide enough of a proof-of-concept to prompt an informed
|
||||
discussion about a good path forward for ECH support in curl.
|
||||
|
||||
## OpenSSL Build
|
||||
|
||||
To build the OpenSSL project's ECH feature branch:
|
||||
|
||||
```bash
|
||||
cd $HOME/code
|
||||
git clone https://github.com/openssl/openssl
|
||||
cd openssl
|
||||
git checkout feature/ech
|
||||
./config --libdir=lib --prefix=$HOME/code/openssl-local-inst
|
||||
...stuff...
|
||||
make -j8
|
||||
...more stuff...
|
||||
make install_sw
|
||||
...a little bit of stuff...
|
||||
```
|
||||
|
||||
To build curl ECH-enabled, making use of the above:
|
||||
|
||||
```bash
|
||||
cd $HOME/code
|
||||
git clone https://github.com/curl/curl
|
||||
cd curl
|
||||
autoreconf -fi
|
||||
LDFLAGS="-Wl,-rpath,$HOME/code/openssl-local-inst/lib/" ./configure --with-ssl=$HOME/code/openssl-local-inst --enable-ech
|
||||
...lots of output...
|
||||
WARNING: ECH HTTPSRR enabled but marked EXPERIMENTAL...
|
||||
make
|
||||
...lots more output...
|
||||
```
|
||||
|
||||
If you do not get that WARNING at the end of the ``configure`` command, then
|
||||
ECH is not enabled, so go back some steps and re-do whatever needs re-doing:-)
|
||||
If you want to debug curl then you should add ``--enable-debug`` to the
|
||||
``configure`` command.
|
||||
|
||||
In a recent (2024-05-20) build on one machine, configure failed to find the
|
||||
ECH-enabled SSL library, apparently due to the existence of
|
||||
``$HOME/code/openssl-local-inst/lib/pkgconfig`` as a directory containing
|
||||
various settings. Deleting that directory worked around the problem but may
|
||||
not be the best solution.
|
||||
|
||||
## Using ECH and DoH
|
||||
|
||||
curl supports using DoH for A/AAAA lookups so it was relatively easy to add
|
||||
retrieval of HTTPS RRs in that situation. To use ECH and DoH together:
|
||||
|
||||
```bash
|
||||
cd $HOME/code/curl
|
||||
LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl --ech true --doh-url https://one.one.one.one/dns-query https://defo.ie/ech-check.php
|
||||
...
|
||||
SSL_ECH_STATUS: success <img src="greentick-small.png" alt="good" /> <br/>
|
||||
...
|
||||
```
|
||||
|
||||
The output snippet above is within the HTML for the webpage, when things work.
|
||||
|
||||
The above works for these test sites:
|
||||
|
||||
```bash
|
||||
https://defo.ie/ech-check.php
|
||||
https://draft-13.esni.defo.ie:8413/stats
|
||||
https://draft-13.esni.defo.ie:8414/stats
|
||||
https://crypto.cloudflare.com/cdn-cgi/trace
|
||||
https://tls-ech.dev
|
||||
```
|
||||
|
||||
The list above has 4 different server technologies, implemented by 3 different
|
||||
parties, and includes a case (the port 8414 server) where HelloRetryRequest
|
||||
(HRR) is forced.
|
||||
|
||||
We currently support the following new curl command line arguments/options:
|
||||
|
||||
- ``--ech <config>`` - the ``config`` value can be one of:
|
||||
- ``false`` says to not attempt ECH
|
||||
- ``true`` says to attempt ECH, if possible
|
||||
- ``grease`` if attempting ECH is not possible, then send a GREASE ECH extension
|
||||
- ``hard`` hard-fail the connection if ECH cannot be attempted
|
||||
- ``ecl:<b64value>`` a base64 encoded ECHConfigList, rather than one accessed from the DNS
|
||||
- ``pn:<name>`` override the ``public_name`` from an ECHConfigList
|
||||
|
||||
Note that in the above "attempt ECH" means the client emitting a TLS
|
||||
ClientHello with a "real" ECH extension, but that does not mean that the
|
||||
relevant server can succeed in decrypting, as things can fail for other
|
||||
reasons.
|
||||
|
||||
## Supplying an ECHConfigList on the command line
|
||||
|
||||
To supply the ECHConfigList on the command line, you might need a bit of
|
||||
cut-and-paste, e.g.:
|
||||
|
||||
```bash
|
||||
dig +short https defo.ie
|
||||
1 . ipv4hint=213.108.108.101 ech=AED+DQA8PAAgACD8WhlS7VwEt5bf3lekhHvXrQBGDrZh03n/LsNtAodbUAAEAAEAAQANY292ZXIuZGVmby5pZQAA ipv6hint=2a00:c6c0:0:116:5::10
|
||||
```
|
||||
|
||||
Then paste the base64 encoded ECHConfigList onto the curl command line:
|
||||
|
||||
```bash
|
||||
LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl --ech ecl:AED+DQA8PAAgACD8WhlS7VwEt5bf3lekhHvXrQBGDrZh03n/LsNtAodbUAAEAAEAAQANY292ZXIuZGVmby5pZQAA https://defo.ie/ech-check.php
|
||||
...
|
||||
SSL_ECH_STATUS: success <img src="greentick-small.png" alt="good" /> <br/>
|
||||
...
|
||||
```
|
||||
|
||||
The output snippet above is within the HTML for the webpage.
|
||||
|
||||
If you paste in the wrong ECHConfigList (it changes hourly for ``defo.ie``) you
|
||||
should get an error like this:
|
||||
|
||||
```bash
|
||||
LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl -vvv --ech ecl:AED+DQA8yAAgACDRMQo+qYNsNRNj+vfuQfFIkrrUFmM4vogucxKj/4nzYgAEAAEAAQANY292ZXIuZGVmby5pZQAA https://defo.ie/ech-check.php
|
||||
...
|
||||
* OpenSSL/3.3.0: error:0A00054B:SSL routines::ech required
|
||||
...
|
||||
```
|
||||
|
||||
There is a reason to want this command line option - for use before publishing
|
||||
an ECHConfigList in the DNS as per the Internet-draft [A well-known URI for
|
||||
publishing ECHConfigList values](https://datatracker.ietf.org/doc/draft-ietf-tls-wkech/).
|
||||
|
||||
If you do use a wrong ECHConfigList value, then the server might return a
|
||||
good value, via the ``retry_configs`` mechanism. You can see that value in
|
||||
the verbose output, e.g.:
|
||||
|
||||
```bash
|
||||
LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl -vvv --ech ecl:AED+DQA8yAAgACDRMQo+qYNsNRNj+vfuQfFIkrrUFmM4vogucxKj/4nzYgAEAAEAAQANY292ZXIuZGVmby5pZQAA https://defo.ie/ech-check.php
|
||||
...
|
||||
* ECH: retry_configs AQD+DQA8DAAgACBvYqJy+Hgk33wh/ZLBzKSPgwxeop7gvojQzfASq7zeZQAEAAEAAQANY292ZXIuZGVmby5pZQAA/g0APEMAIAAgXkT5r4cYs8z19q5rdittyIX8gfQ3ENW4wj1fVoiJZBoABAABAAEADWNvdmVyLmRlZm8uaWUAAP4NADw2ACAAINXSE9EdXzEQIJZA7vpwCIQsWqsFohZARXChgPsnfI1kAAQAAQABAA1jb3Zlci5kZWZvLmllAAD+DQA8cQAgACASeiD5F+UoSnVoHvA2l1EifUVMFtbVZ76xwDqmMPraHQAEAAEAAQANY292ZXIuZGVmby5pZQAA
|
||||
* ECH: retry_configs for defo.ie from cover.defo.ie, 319
|
||||
...
|
||||
```
|
||||
|
||||
At that point, you could copy the base64 encoded value above and try again.
|
||||
For now, this only works for the OpenSSL and BoringSSL/AWS-LC builds.
|
||||
|
||||
## Default settings
|
||||
|
||||
curl has various ways to configure default settings, e.g. in ``$HOME/.curlrc``,
|
||||
so one can set the DoH URL and enable ECH that way:
|
||||
|
||||
```bash
|
||||
cat ~/.curlrc
|
||||
doh-url=https://one.one.one.one/dns-query
|
||||
silent
|
||||
ech=true
|
||||
```
|
||||
|
||||
Note that when you use the system's curl command (rather than our ECH-enabled
|
||||
build), it is liable to warn that ``ech`` is an unknown option. If that is an
|
||||
issue (e.g. if some script re-directs stdout and stderr somewhere) then adding
|
||||
the ``silent`` line above seems to be a good enough fix. (Though of
|
||||
course, yet another script could depend on non-silent behavior, so you may have
|
||||
to figure out what you prefer yourself.) That seems to have changed with the
|
||||
latest build, previously ``silent=TRUE`` was what I used in ``~/.curlrc`` but
|
||||
now that seems to cause a problem, so that the following line(s) are ignored.
|
||||
|
||||
If you want to always use our OpenSSL build you can set ``LD_LIBRARY_PATH``
|
||||
in the environment:
|
||||
|
||||
```bash
|
||||
export LD_LIBRARY_PATH=$HOME/code/openssl
|
||||
```
|
||||
|
||||
When you do the above, there can be a mismatch between OpenSSL versions
|
||||
for applications that check that. A ``git push`` for example fails so you
|
||||
should unset ``LD_LIBRARY_PATH`` before doing that or use a different shell.
|
||||
|
||||
```bash
|
||||
git push
|
||||
OpenSSL version mismatch. Built against 30000080, you have 30200000
|
||||
...
|
||||
```
|
||||
|
||||
With all that setup as above the command line gets simpler:
|
||||
|
||||
```bash
|
||||
./src/curl https://defo.ie/ech-check.php
|
||||
...
|
||||
SSL_ECH_STATUS: success <img src="greentick-small.png" alt="good" /> <br/>
|
||||
...
|
||||
```
|
||||
|
||||
The ``--ech true`` option is opportunistic, so tries to do ECH but does not fail if
|
||||
the client for example cannot find any ECHConfig values. The ``--ech hard``
|
||||
option hard-fails if there is no ECHConfig found in DNS, so for now, that is not
|
||||
a good option to set as a default. Once ECH has really been attempted by
|
||||
the client, if decryption on the server side fails, then curl fails.
|
||||
|
||||
## Code changes for ECH support when using DoH
|
||||
|
||||
Code changes are ``#ifdef`` protected via ``USE_ECH`` or ``USE_HTTPSRR``:
|
||||
|
||||
- ``USE_HTTPSRR`` is used for HTTPS RR retrieval code that could be generically
|
||||
used should non-ECH uses for HTTPS RRs be identified, e.g. use of ALPN values
|
||||
or IP address hints.
|
||||
|
||||
- ``USE_ECH`` protects ECH specific code.
|
||||
|
||||
There are various obvious code blocks for handling the new command line
|
||||
arguments which are not described here, but should be fairly clear.
|
||||
|
||||
As shown in the ``configure`` usage above, there are ``configure.ac`` changes
|
||||
that allow separately dis/enabling ``USE_HTTPSRR`` and ``USE_ECH``. If ``USE_ECH``
|
||||
is enabled, then ``USE_HTTPSRR`` is forced. In both cases ``CURL_DISABLE_DOH``
|
||||
must not be enabled. (There may be some configuration conflicts available for the
|
||||
determined :-)
|
||||
|
||||
The main functional change, as you would expect, is in ``lib/vtls/openssl.c``
|
||||
where an ECHConfig, if available from command line or DNS cache, is fed into
|
||||
the OpenSSL library via the new APIs implemented in our OpenSSL fork for that
|
||||
purpose. This code also implements the opportunistic (``--ech true``) or hard-fail
|
||||
(``--ech hard``) logic.
|
||||
|
||||
Other than that, the main additions are in ``lib/doh.c``
|
||||
where we reuse ``dohprobe()`` to retrieve an HTTPS RR value for the target
|
||||
domain. If such a value is found, that is stored using a new ``doh_store_https()``
|
||||
function in a new field in the ``dohentry`` structure.
|
||||
|
||||
The qname for the DoH query is modified if the port number is not 443, as
|
||||
defined in the SVCB specification.
|
||||
|
||||
When the DoH process has worked, ``Curl_doh_is_resolved()`` now also returns
|
||||
the relevant HTTPS RR value data in the ``Curl_dns_entry`` structure.
|
||||
That is later accessed when the TLS session is being established, if ECH is
|
||||
enabled (from ``lib/vtls/openssl.c`` as described above).
|
||||
|
||||
## Limitations
|
||||
|
||||
Things that need fixing, but that can probably be ignored for the
|
||||
moment:
|
||||
|
||||
- We could easily add code to make use of an ``alpn=`` value found in an HTTPS
|
||||
RR, passing that on to OpenSSL for use as the "inner" ALPN value, but have
|
||||
yet to do that.
|
||||
|
||||
Current limitations (more interesting than the above):
|
||||
|
||||
- Only the first HTTPS RR value retrieved is actually processed as described
|
||||
above, that could be extended in future, though picking the "right" HTTPS RR
|
||||
could be non-trivial if multiple RRs are published - matching IP address hints
|
||||
versus A/AAAA values might be a good basis for that. Last I checked though,
|
||||
browsers supporting ECH did not handle multiple HTTPS RRs well, though that
|
||||
needs re-checking as it has been a while.
|
||||
|
||||
- It is unclear how one should handle any IP address hints found in an HTTPS RR.
|
||||
It may be that a bit of consideration of how "multi-CDN" deployments might
|
||||
emerge would provide good answers there, but for now, it is not clear how best
|
||||
curl might handle those values when present in the DNS.
|
||||
|
||||
- The SVCB/HTTPS RR specification supports a new "CNAME at apex" indirection
|
||||
("aliasMode") - the current code takes no account of that at all. One could
|
||||
envisage implementing the equivalent of following CNAMEs in such cases, but
|
||||
it is not clear if that'd be a good plan. (As of now, chrome browsers do not seem
|
||||
to have any support for that "aliasMode" and we have not checked Firefox for that
|
||||
recently.)
|
||||
|
||||
- We have not investigated what related changes or additions might be needed
|
||||
for applications using libcurl, as opposed to use of curl as a command line
|
||||
tool.
|
||||
|
||||
- We have not yet implemented tests as part of the usual curl test harness as
|
||||
doing so would seem to require re-implementing an ECH-enabled server as part
|
||||
of the curl test harness. For now, we have a ``./tests/ech_test.sh`` script
|
||||
that attempts ECH with various test servers and with many combinations of the
|
||||
allowed command line options. While that is a useful test and has find issues,
|
||||
it is not comprehensive and we are not (as yet) sure what would be the right
|
||||
level of coverage. When running that script you should not have a
|
||||
``$HOME/.curlrc`` file that affects ECH or some of the negative tests could
|
||||
produce spurious failures.
|
||||
|
||||
## Building with cmake
|
||||
|
||||
To build with cmake, assuming our ECH-enabled OpenSSL is as before:
|
||||
|
||||
```bash
|
||||
cd $HOME/code
|
||||
git clone https://github.com/curl/curl
|
||||
cd curl
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DOPENSSL_ROOT_DIR=$HOME/code/openssl -DUSE_ECH=1 ..
|
||||
...
|
||||
make
|
||||
...
|
||||
[100%] Built target curl
|
||||
```
|
||||
|
||||
The binary produced by the cmake build does not need any ECH-specific
|
||||
``LD_LIBRARY_PATH`` setting.
|
||||
|
||||
## BoringSSL build
|
||||
|
||||
BoringSSL is also supported by curl and also supports ECH, so to build
|
||||
with that, instead of our ECH-enabled OpenSSL:
|
||||
|
||||
```bash
|
||||
cd $HOME/code
|
||||
git clone https://boringssl.googlesource.com/boringssl
|
||||
cd boringssl
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/code/boringssl/inst -DBUILD_SHARED_LIBS=1
|
||||
make
|
||||
...
|
||||
make install
|
||||
```
|
||||
|
||||
Then:
|
||||
|
||||
```bash
|
||||
cd $HOME/code
|
||||
git clone https://github.com/curl/curl
|
||||
cd curl
|
||||
autoreconf -fi
|
||||
LDFLAGS="-Wl,-rpath,$HOME/code/boringssl/inst/lib" ./configure --with-ssl=$HOME/code/boringssl/inst --enable-ech
|
||||
...lots of output...
|
||||
WARNING: ECH HTTPSRR enabled but marked EXPERIMENTAL. Use with caution.
|
||||
make
|
||||
```
|
||||
|
||||
The BoringSSL/AWS-LC APIs are fairly similar to those in our ECH-enabled
|
||||
OpenSSL fork, so code changes are also in ``lib/vtls/openssl.c``, protected
|
||||
via ``#ifdef OPENSSL_IS_BORINGSSL`` and are mostly obvious API variations.
|
||||
|
||||
The BoringSSL/AWS-LC APIs however do not support the ``--ech pn:`` command
|
||||
line variant as of now.
|
||||
|
||||
## wolfSSL build
|
||||
|
||||
wolfSSL also supports ECH and can be used by curl, so here's how:
|
||||
|
||||
```bash
|
||||
cd $HOME/code
|
||||
git clone https://github.com/wolfSSL/wolfssl
|
||||
cd wolfssl
|
||||
./autogen.sh
|
||||
./configure --prefix=$HOME/code/wolfssl/inst --enable-ech --enable-debug --enable-opensslextra
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
The install prefix (``inst``) in the above causes wolfSSL to be installed there
|
||||
and we seem to need that for the curl configure command to work out. The
|
||||
``--enable-opensslextra`` turns out (after much faffing about;-) to be
|
||||
important or else we get build problems with curl below.
|
||||
|
||||
```bash
|
||||
cd $HOME/code
|
||||
git clone https://github.com/curl/curl
|
||||
cd curl
|
||||
autoreconf -fi
|
||||
./configure --with-wolfssl=$HOME/code/wolfssl/inst --enable-ech
|
||||
make
|
||||
```
|
||||
|
||||
There are some known issues with the ECH implementation in wolfSSL:
|
||||
|
||||
- The main issue is that the client currently handles HelloRetryRequest
|
||||
incorrectly. [HRR issue](https://github.com/wolfSSL/wolfssl/issues/6802).)
|
||||
The HRR issue means that the client does not work for
|
||||
[this ECH test web site](https://tls-ech.dev) and any other similarly configured
|
||||
sites.
|
||||
- There is also an issue related to so-called middlebox compatibility mode.
|
||||
[middlebox compatibility issue](https://github.com/wolfSSL/wolfssl/issues/6774)
|
||||
|
||||
### Code changes to support wolfSSL
|
||||
|
||||
There are what seem like oddball differences:
|
||||
|
||||
- The DoH URL in``$HOME/.curlrc`` can use `1.1.1.1` for OpenSSL but has to be
|
||||
`one.one.one.one` for wolfSSL. The latter works for both, so OK, we us that.
|
||||
- There seems to be some difference in CA databases too - the wolfSSL version
|
||||
does not like ``defo.ie``, whereas the system and OpenSSL ones do. We can
|
||||
ignore that for our purposes via ``--insecure``/``-k`` but would need to fix
|
||||
for a real setup. (Browsers do like those certificates though.)
|
||||
|
||||
Then there are some functional code changes:
|
||||
|
||||
- tweak to ``configure.ac`` to check if wolfSSL has ECH or not
|
||||
- added code to ``lib/vtls/wolfssl.c`` mirroring what's done in the
|
||||
OpenSSL equivalent above.
|
||||
- wolfSSL does not support ``--ech false`` or the ``--ech pn:`` command line
|
||||
argument.
|
||||
|
||||
The lack of support for ``--ech false`` is because wolfSSL has decided to
|
||||
always at least GREASE if built to support ECH. In other words, GREASE is
|
||||
a compile time choice for wolfSSL, but a runtime choice for OpenSSL or
|
||||
BoringSSL/AWS-LC. (Both are reasonable.)
|
||||
|
||||
## Additional notes
|
||||
|
||||
### Supporting ECH without DoH
|
||||
|
||||
All of the above only applies if DoH is being used. There should be a use-case
|
||||
for ECH when DoH is not used by curl - if a system stub resolver supports DoT
|
||||
or DoH, then, considering only ECH and the network threat model, it would make
|
||||
sense for curl to support ECH without curl itself using DoH. The author for
|
||||
example uses a combination of stubby+unbound as the system resolver listening
|
||||
on localhost:53, so would fit this use-case. That said, it is unclear if
|
||||
this is a niche that is worth trying to address. (The author is just as happy to
|
||||
let curl use DoH to talk to the same public recursive that stubby might use:-)
|
||||
|
||||
Assuming for the moment this is a use-case we would like to support, then if
|
||||
DoH is not being used by curl, it is not clear at this time how to provide
|
||||
support for ECH. One option would seem to be to extend the ``c-ares`` library
|
||||
to support HTTPS RRs, but in that case it is not now clear whether such
|
||||
changes would be attractive to the ``c-ares`` maintainers, nor whether the
|
||||
"tag=value" extensibility inherent in the HTTPS/SVCB specification is a good
|
||||
match for the ``c-ares`` approach of defining structures specific to decoded
|
||||
answers for each supported RRtype. We are also not sure how many downstream
|
||||
curl deployments actually make use of the ``c-ares`` library, which would
|
||||
affect the utility of such changes. Another option might be to consider using
|
||||
some other generic DNS library that does support HTTPS RRs, but it is unclear
|
||||
if such a library could or would be used by all or almost all curl builds and
|
||||
downstream releases of curl.
|
||||
|
||||
Our current conclusion is that doing the above is likely best left until we
|
||||
have some experience with the "using DoH" approach, so we are going to punt on
|
||||
this for now.
|
||||
|
||||
### Debugging
|
||||
|
||||
Just a note to self as remembering this is a nuisance:
|
||||
|
||||
```bash
|
||||
LD_LIBRARY_PATH=$HOME/code/openssl:./lib/.libs gdb ./src/.libs/curl
|
||||
```
|
||||
|
||||
### Localhost testing
|
||||
|
||||
It can be useful to be able to run against a localhost OpenSSL ``s_server``
|
||||
for testing. We have published instructions for such
|
||||
[localhost tests](https://github.com/defo-project/ech-dev-utils/blob/main/howtos/localhost-tests.md)
|
||||
in another repository. Once you have that set up, you can start a server
|
||||
and then run curl against that:
|
||||
|
||||
```bash
|
||||
cd $HOME/code/ech-dev-utils
|
||||
./scripts/echsvr.sh -d
|
||||
...
|
||||
```
|
||||
|
||||
The ``echsvr.sh`` script supports many ECH-related options. Use ``echsvr.sh -h``
|
||||
for details.
|
||||
|
||||
In another window:
|
||||
|
||||
```bash
|
||||
cd $HOME/code/curl/
|
||||
./src/curl -vvv --insecure --connect-to foo.example.com:8443:localhost:8443 --ech ecl:AD7+DQA6uwAgACBix2B78sX+EQhEbxMspDOc8Z3xVS5aQpYP0Cxpc2AWPAAEAAEAAQALZXhhbXBsZS5jb20AAA==
|
||||
```
|
||||
|
||||
### Automated use of ``retry_configs`` not supported so far...
|
||||
|
||||
As of now we have not added support for using ``retry_config`` handling in the
|
||||
application - for a command line tool, one can just use ``dig`` (or ``kdig``)
|
||||
to get the HTTPS RR and pass the ECHConfigList from that on the command line,
|
||||
if needed, or one can access the value from command line output in verbose more
|
||||
and then reuse that in another invocation.
|
||||
|
||||
Both our OpenSSL fork and BoringSSL/AWS-LC have APIs for both controlling GREASE
|
||||
and accessing and logging ``retry_configs``, it seems wolfSSL has neither.
|
||||
|
||||
### Testing ECH
|
||||
|
||||
We have yet to add a robust test setup for ECH as that requires an ECH-enabled
|
||||
test server.
|
||||
|
||||
We have added two basic tests though, aiming to ensure that the client sends a
|
||||
GREASE or real ECH extension when requested, and reacts correctly to the
|
||||
failure of ECH in the latter case. (Given that `stunnel` has no ECH support.)
|
||||
|
||||
As with other similar tests, those tests require the `stunnel` tool be
|
||||
installed. On Ubuntu `sudo apt install stunnel4` achieves that.
|
||||
|
||||
The test cases are:
|
||||
|
||||
- data/test4000: GREASE ECH, expected result: connection succeeds
|
||||
- data/test4001: real ECH, connection fails with error 101 (ECH required)
|
||||
@@ -1,90 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Experimental
|
||||
|
||||
Some features and functionality in curl and libcurl are considered
|
||||
**EXPERIMENTAL**.
|
||||
|
||||
Experimental support in curl means:
|
||||
|
||||
1. Experimental features are provided to allow users to try them out and
|
||||
provide feedback on functionality and API etc before they ship and get
|
||||
"carved in stone".
|
||||
2. You must enable the feature when invoking configure as otherwise curl is
|
||||
not built with the feature present.
|
||||
3. We strongly advise against using this feature in production.
|
||||
4. **We reserve the right to change behavior** of the feature without sticking
|
||||
to our API/ABI rules as we do for regular features, as long as it is marked
|
||||
experimental.
|
||||
5. Experimental features are clearly marked so in documentation. Beware.
|
||||
|
||||
## Graduation
|
||||
|
||||
1. Each experimental feature should have a set of documented requirements of
|
||||
what is needed for that feature to graduate. Graduation means being removed
|
||||
from the list of experiments.
|
||||
2. An experiment should NOT graduate if it needs test cases to be disabled,
|
||||
unless they are for minor features that are clearly documented as not
|
||||
provided by the experiment and then the disabling should be managed inside
|
||||
each affected test case.
|
||||
|
||||
## Experimental features right now
|
||||
|
||||
### HTTP/3 support (non-ngtcp2 backends)
|
||||
|
||||
Graduation requirements:
|
||||
|
||||
- The used libraries should be considered out-of-beta with a reasonable
|
||||
expectation of a stable API going forward.
|
||||
|
||||
- Using HTTP/3 with the given build should perform without risking busy-loops
|
||||
|
||||
### The Rustls backend
|
||||
|
||||
Graduation requirements:
|
||||
|
||||
- a reasonable expectation of a stable API going forward.
|
||||
|
||||
## ECH
|
||||
|
||||
Use of the HTTPS resource record and Encrypted Client Hello (ECH) when using
|
||||
DoH
|
||||
|
||||
Graduation requirements:
|
||||
|
||||
- ECH support exists in at least one widely used TLS library apart from
|
||||
BoringSSL and wolfSSL.
|
||||
|
||||
- feedback from users saying that ECH works for their use cases
|
||||
|
||||
- it has been given time to mature, so no earlier than April 2025 (twelve
|
||||
months after being added here)
|
||||
|
||||
## SSL session import/export
|
||||
|
||||
Import/Export of SSL sessions tickets in libcurl and curl command line
|
||||
option '--ssl-session <filename>' for faster TLS handshakes and use
|
||||
of TLSv1.3/QUIC Early Data (0-RTT).
|
||||
|
||||
Graduation requirements:
|
||||
|
||||
- the implementation is considered safe
|
||||
|
||||
- feedback from users saying that session export works for their use cases
|
||||
|
||||
## HTTPS RR
|
||||
|
||||
HTTPS records support is a requirement for ECH but is provided as a
|
||||
stand-alone feature that is itself considered EXPERIMENTAL.
|
||||
|
||||
Graduation requirements:
|
||||
|
||||
- HTTPS records work for DoH, c-ares and the threaded resolver
|
||||
|
||||
- HTTPS records can control ALPN and port number, at least
|
||||
|
||||
- There are options to control HTTPS use
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,249 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Features -- what curl can do
|
||||
|
||||
## curl tool
|
||||
|
||||
- config file support
|
||||
- multiple URLs in a single command line
|
||||
- range "globbing" support: [0-13], {one,two,three}
|
||||
- multiple file upload on a single command line
|
||||
- redirect stderr
|
||||
- parallel transfers
|
||||
|
||||
## libcurl
|
||||
|
||||
- URL RFC 3986 syntax
|
||||
- custom maximum download time
|
||||
- custom lowest download speed acceptable
|
||||
- custom output result after completion
|
||||
- guesses protocol from hostname unless specified
|
||||
- supports .netrc
|
||||
- progress bar with time statistics while downloading
|
||||
- standard proxy environment variables support
|
||||
- have run on 101 operating systems and 28 CPU architectures
|
||||
- selectable network interface for outgoing traffic
|
||||
- IPv6 support on Unix and Windows
|
||||
- happy eyeballs dual-stack IPv4 + IPv6 connects
|
||||
- persistent connections
|
||||
- SOCKS 4 + 5 support, with or without local name resolving
|
||||
- *pre-proxy* support, for *proxy chaining*
|
||||
- supports username and password in proxy environment variables
|
||||
- operations through HTTP proxy "tunnel" (using CONNECT)
|
||||
- replaceable memory functions (malloc, free, realloc, etc)
|
||||
- asynchronous name resolving
|
||||
- both a push and a pull style interface
|
||||
- international domain names (IDN)
|
||||
- transfer rate limiting
|
||||
- stable API and ABI
|
||||
- TCP keep alive
|
||||
- TCP Fast Open
|
||||
- DNS cache (that can be shared between transfers)
|
||||
- non-blocking single-threaded parallel transfers
|
||||
- Unix domain sockets to server or proxy
|
||||
- DNS-over-HTTPS
|
||||
- uses non-blocking name resolves
|
||||
- selectable name resolver backend
|
||||
|
||||
## URL API
|
||||
|
||||
- parses RFC 3986 URLs
|
||||
- generates URLs from individual components
|
||||
- manages "redirects"
|
||||
|
||||
## Header API
|
||||
|
||||
- easy access to HTTP response headers, from all contexts
|
||||
- named headers
|
||||
- iterate over headers
|
||||
|
||||
## TLS
|
||||
|
||||
- selectable TLS backend(s)
|
||||
- TLS False Start
|
||||
- TLS version control
|
||||
- TLS session resumption
|
||||
- key pinning
|
||||
- mutual authentication
|
||||
- Use dedicated CA cert bundle
|
||||
- Use OS-provided CA store
|
||||
- separate TLS options for HTTPS proxy
|
||||
|
||||
## HTTP
|
||||
|
||||
- HTTP/0.9 responses are optionally accepted
|
||||
- HTTP/1.0
|
||||
- HTTP/1.1
|
||||
- HTTP/2, including multiplexing and server push
|
||||
- GET
|
||||
- PUT
|
||||
- HEAD
|
||||
- POST
|
||||
- multipart formpost (RFC 1867-style)
|
||||
- authentication: Basic, Digest, NTLM (9) and Negotiate (SPNEGO)
|
||||
to server and proxy
|
||||
- resume transfers
|
||||
- follow redirects
|
||||
- maximum amount of redirects to follow
|
||||
- custom HTTP request
|
||||
- cookie get/send fully parsed
|
||||
- reads/writes the Netscape cookie file format
|
||||
- custom headers (replace/remove internally generated headers)
|
||||
- custom user-agent string
|
||||
- custom referrer string
|
||||
- range
|
||||
- proxy authentication
|
||||
- time conditions
|
||||
- via HTTP proxy, HTTPS proxy or SOCKS proxy
|
||||
- HTTP/2 or HTTP/1.1 to HTTPS proxy
|
||||
- retrieve file modification date
|
||||
- Content-Encoding support for deflate, gzip, brotli and zstd
|
||||
- "Transfer-Encoding: chunked" support in uploads
|
||||
- HSTS
|
||||
- alt-svc
|
||||
- ETags
|
||||
- HTTP/1.1 trailers, both sending and getting
|
||||
|
||||
## HTTPS
|
||||
|
||||
- HTTP/3
|
||||
- using client certificates
|
||||
- verify server certificate
|
||||
- via HTTP proxy, HTTPS proxy or SOCKS proxy
|
||||
- select desired encryption
|
||||
- select usage of a specific TLS version
|
||||
- ECH
|
||||
|
||||
## FTP
|
||||
|
||||
- download
|
||||
- authentication
|
||||
- Kerberos 5
|
||||
- active/passive using PORT, EPRT, PASV or EPSV
|
||||
- single file size information (compare to HTTP HEAD)
|
||||
- 'type=' URL support
|
||||
- directory listing
|
||||
- directory listing names-only
|
||||
- upload
|
||||
- upload append
|
||||
- upload via http-proxy as HTTP PUT
|
||||
- download resume
|
||||
- upload resume
|
||||
- custom ftp commands (before and/or after the transfer)
|
||||
- simple "range" support
|
||||
- via HTTP proxy, HTTPS proxy or SOCKS proxy
|
||||
- all operations can be tunneled through proxy
|
||||
- customizable to retrieve file modification date
|
||||
- no directory depth limit
|
||||
|
||||
## FTPS
|
||||
|
||||
- implicit `ftps://` support that use SSL on both connections
|
||||
- explicit "AUTH TLS" and "AUTH SSL" usage to "upgrade" plain `ftp://`
|
||||
connection to use SSL for both or one of the connections
|
||||
|
||||
## SSH (both SCP and SFTP)
|
||||
|
||||
- selectable SSH backend
|
||||
- known hosts support
|
||||
- public key fingerprinting
|
||||
- both password and public key auth
|
||||
|
||||
## SFTP
|
||||
|
||||
- both password and public key auth
|
||||
- with custom commands sent before/after the transfer
|
||||
- directory listing
|
||||
|
||||
## TFTP
|
||||
|
||||
- download
|
||||
- upload
|
||||
|
||||
## TELNET
|
||||
|
||||
- connection negotiation
|
||||
- custom telnet options
|
||||
- stdin/stdout I/O
|
||||
|
||||
## LDAP
|
||||
|
||||
- full LDAP URL support
|
||||
|
||||
## DICT
|
||||
|
||||
- extended DICT URL support
|
||||
|
||||
## FILE
|
||||
|
||||
- URL support
|
||||
- upload
|
||||
- resume
|
||||
|
||||
## SMB
|
||||
|
||||
- SMBv1 over TCP and SSL
|
||||
- download
|
||||
- upload
|
||||
- authentication with NTLMv1
|
||||
|
||||
## SMTP
|
||||
|
||||
- authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM, Kerberos 5 and
|
||||
External
|
||||
- send emails
|
||||
- mail from support
|
||||
- mail size support
|
||||
- mail auth support for trusted server-to-server relaying
|
||||
- multiple recipients
|
||||
- via http-proxy
|
||||
|
||||
## SMTPS
|
||||
|
||||
- implicit `smtps://` support
|
||||
- explicit "STARTTLS" usage to "upgrade" plain `smtp://` connections to use SSL
|
||||
- via http-proxy
|
||||
|
||||
## POP3
|
||||
|
||||
- authentication: Clear Text, APOP and SASL
|
||||
- SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM,
|
||||
Kerberos 5 and External
|
||||
- list emails
|
||||
- retrieve emails
|
||||
- enhanced command support for: CAPA, DELE, TOP, STAT, UIDL and NOOP via
|
||||
custom requests
|
||||
- via http-proxy
|
||||
|
||||
## POP3S
|
||||
|
||||
- implicit `pop3s://` support
|
||||
- explicit `STLS` usage to "upgrade" plain `pop3://` connections to use SSL
|
||||
- via http-proxy
|
||||
|
||||
## IMAP
|
||||
|
||||
- authentication: Clear Text and SASL
|
||||
- SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM,
|
||||
Kerberos 5 and External
|
||||
- list the folders of a mailbox
|
||||
- select a mailbox with support for verifying the `UIDVALIDITY`
|
||||
- fetch emails with support for specifying the UID and SECTION
|
||||
- upload emails via the append command
|
||||
- enhanced command support for: EXAMINE, CREATE, DELETE, RENAME, STATUS,
|
||||
STORE, COPY and UID via custom requests
|
||||
- via http-proxy
|
||||
|
||||
## IMAPS
|
||||
|
||||
- implicit `imaps://` support
|
||||
- explicit "STARTTLS" usage to "upgrade" plain `imap://` connections to use SSL
|
||||
- via http-proxy
|
||||
|
||||
## MQTT
|
||||
|
||||
- Subscribe to and publish topics using URL scheme `mqtt://broker/topic`
|
||||
@@ -1,202 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Decision making in the curl project
|
||||
|
||||
A rough guide to how we make decisions and who does what.
|
||||
|
||||
## BDFL
|
||||
|
||||
This project was started by and has to some extent been pushed forward over
|
||||
the years with Daniel Stenberg as the driving force. It matches a standard
|
||||
BDFL (Benevolent Dictator For Life) style project.
|
||||
|
||||
This setup has been used due to convenience and the fact that it has worked
|
||||
fine this far. It is not because someone thinks of it as a superior project
|
||||
leadership model. It also only works as long as Daniel manages to listen in to
|
||||
what the project and the general user population wants and expects from us.
|
||||
|
||||
## Legal entity
|
||||
|
||||
There is no legal entity. The curl project is just a bunch of people scattered
|
||||
around the globe with the common goal to produce source code that creates
|
||||
great products. We are not part of any umbrella organization and we are not
|
||||
located in any specific country. We are totally independent.
|
||||
|
||||
The copyrights in the project are owned by the individuals and organizations
|
||||
that wrote those parts of the code.
|
||||
|
||||
## Decisions
|
||||
|
||||
The curl project is not a democracy, but everyone is entitled to state their
|
||||
opinion and may argue for their sake within the community.
|
||||
|
||||
All and any changes that have been done or are done are eligible to bring up
|
||||
for discussion, to object to or to praise. Ideally, we find consensus for the
|
||||
appropriate way forward in any given situation or challenge.
|
||||
|
||||
If there is no obvious consensus, a maintainer who's knowledgeable in the
|
||||
specific area takes an "executive" decision that they think is the right for
|
||||
the project.
|
||||
|
||||
## Donations
|
||||
|
||||
Donating plain money to curl is best done to curl's [Open Collective
|
||||
fund](https://opencollective.com/curl). Open Collective is a US based
|
||||
non-profit organization that holds on to funds for us. This fund is then used
|
||||
for paying the curl security bug bounties, to reimburse project related
|
||||
expenses etc.
|
||||
|
||||
Donations to the project can also come in the form of server hosting, providing
|
||||
services and paying for people to work on curl related code etc. Usually, such
|
||||
donations are services paid for directly by the sponsors.
|
||||
|
||||
We grade sponsors in a few different levels and if they meet the criteria,
|
||||
they can be mentioned on the Sponsors page on the curl website.
|
||||
|
||||
## Commercial Support
|
||||
|
||||
The curl project does not do or offer commercial support. It only hosts
|
||||
mailing lists, runs bug trackers etc to facilitate communication and work.
|
||||
|
||||
However, Daniel works for wolfSSL and we offer commercial curl support there.
|
||||
|
||||
# Key roles
|
||||
|
||||
## User
|
||||
|
||||
Someone who uses or has used curl or libcurl.
|
||||
|
||||
## Contributor
|
||||
|
||||
Someone who has helped the curl project, who has contributed to bring it
|
||||
forward. Contributing could be to provide advice, debug a problem, file a bug
|
||||
report, run test infrastructure or writing code etc.
|
||||
|
||||
## Commit author
|
||||
|
||||
Sometimes also called 'committer'. Someone who has authored a commit in the
|
||||
curl source code repository. Committers are recorded as `Author` in git.
|
||||
|
||||
## Maintainers
|
||||
|
||||
A maintainer in the curl project is an individual who has been given
|
||||
permissions to push commits to one of the git repositories.
|
||||
|
||||
Maintainers are free to push commits to the repositories at they see fit.
|
||||
Maintainers are however expected to listen to feedback from users and any
|
||||
change that is non-trivial in size or nature *should* be brought to the
|
||||
project as a Pull-Request (PR) to allow others to comment/object before merge.
|
||||
|
||||
## Former maintainers
|
||||
|
||||
A maintainer who stops being active in the project gets their push permissions
|
||||
removed at some point. We do this for security reasons but also to make sure
|
||||
that we always have the list of maintainers as "the team that push stuff to
|
||||
curl".
|
||||
|
||||
Getting push permissions removed is not a punishment. Everyone who ever worked
|
||||
on maintaining curl is considered a hero, for all time hereafter.
|
||||
|
||||
## Security team members
|
||||
|
||||
We have a security team. That is the team of people who are subscribed to the
|
||||
curl-security mailing list; the receivers of security reports from users and
|
||||
developers. This list of people varies over time but they are all skilled
|
||||
developers familiar with the curl project.
|
||||
|
||||
The security team works best when it consists of a small set of active
|
||||
persons. We invite new members when the team seems to need it, and we also
|
||||
expect to retire security team members as they "drift off" from the project or
|
||||
just find themselves unable to perform their duties there.
|
||||
|
||||
## Core team
|
||||
|
||||
There is a curl core team. It currently has the same set of members as the
|
||||
security team. It can also be reached on the security email address.
|
||||
|
||||
The core team nominates and invites new members to the team when it sees fit.
|
||||
There is no open member voting or formal ways to be a candidate. Active
|
||||
participants in the curl project who want to join the core team can ask to
|
||||
join.
|
||||
|
||||
The core team is a board of advisors. It deals with project management
|
||||
subjects that need confidentiality or for other reasons cannot be dealt with
|
||||
and discussed in the open (for example reports of code of conduct violations).
|
||||
Project matters should always as far as possible be discussed on open mailing
|
||||
lists.
|
||||
|
||||
## Server admins
|
||||
|
||||
We run a web server, a mailing list and more on the curl project's primary
|
||||
server. That physical machine is owned and run by Haxx. Daniel is the primary
|
||||
admin of all things curl related server stuff, but Björn Stenberg and Linus
|
||||
Feltzing serve as backup admins for when Daniel is gone or unable.
|
||||
|
||||
The primary server is paid for by Haxx. The machine is physically located in a
|
||||
server bunker in Stockholm Sweden, operated by the company Glesys.
|
||||
|
||||
The website contents are served to the web via Fastly and Daniel is the
|
||||
primary curl contact with Fastly.
|
||||
|
||||
## BDFL
|
||||
|
||||
That is Daniel.
|
||||
|
||||
# Maintainers
|
||||
|
||||
A curl maintainer is a project volunteer who has the authority and rights to
|
||||
merge changes into a git repository in the curl project.
|
||||
|
||||
Anyone can aspire to become a curl maintainer.
|
||||
|
||||
### Duties
|
||||
|
||||
There are no mandatory duties. We hope and wish that maintainers consider
|
||||
reviewing patches and help merging them, especially when the changes are
|
||||
within the area of personal expertise and experience.
|
||||
|
||||
### Requirements
|
||||
|
||||
- only merge code that meets our quality and style guide requirements.
|
||||
- *never* merge code without doing a PR first, unless the change is "trivial"
|
||||
- if in doubt, ask for input/feedback from others
|
||||
|
||||
### Recommendations
|
||||
|
||||
- we require two-factor authentication enabled on your GitHub account to
|
||||
reduce risk of malicious source code tampering
|
||||
- consider enabling signed git commits for additional verification of changes
|
||||
|
||||
### Merge advice
|
||||
|
||||
When you are merging patches/pull requests...
|
||||
|
||||
- make sure the commit messages follow our template
|
||||
- squash patch sets into a few logical commits even if the PR did not, if
|
||||
necessary
|
||||
- avoid the "merge" button on GitHub, do it "manually" instead to get full
|
||||
control and full audit trail (GitHub leaves out you as "Committer:")
|
||||
- remember to credit the reporter and the helpers.
|
||||
|
||||
## Who are maintainers?
|
||||
|
||||
The [list of maintainers](https://github.com/orgs/curl/people). Be aware that
|
||||
the level of presence and activity in the project vary greatly between
|
||||
different individuals and over time.
|
||||
|
||||
### Become a maintainer?
|
||||
|
||||
If you think you can help making the project better by shouldering some
|
||||
maintaining responsibilities, then please get in touch.
|
||||
|
||||
You are expected to be familiar with the curl project and its ways of working.
|
||||
You need to have gotten a few quality patches merged as a proof of this.
|
||||
|
||||
### Stop being a maintainer
|
||||
|
||||
If you (appear to) not be active in the project anymore, you may be removed as
|
||||
a maintainer. Thank you for your service.
|
||||
@@ -1,94 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# How to get started helping out in the curl project
|
||||
|
||||
We are always in need of more help. If you are new to the project and are
|
||||
looking for ways to contribute and help out, this document aims to give a few
|
||||
good starting points.
|
||||
|
||||
You may subscribe to the [curl-library mailing
|
||||
list](https://lists.haxx.se/listinfo/curl-library) to keep track of the
|
||||
current discussion topics; or if you are registered on GitHub, you can use the
|
||||
[Discussions section](https://github.com/curl/curl/discussions) on the main
|
||||
curl repository.
|
||||
|
||||
## Scratch your own itch
|
||||
|
||||
One of the best ways is to start working on any problems or issues you have
|
||||
found yourself or perhaps got annoyed at in the past. It can be a spelling
|
||||
error in an error text or a weirdly phrased section in a man page. Hunt it
|
||||
down and report the bug. Or make your first pull request with a fix for that.
|
||||
|
||||
## Smaller tasks
|
||||
|
||||
Some projects mark small issues as "beginner friendly", "bite-sized" or
|
||||
similar. We do not do that in curl since such issues never linger around long
|
||||
enough. Simple issues get handled fast.
|
||||
|
||||
If you are looking for a smaller or simpler task in the project to help out
|
||||
with as an entry-point into the project, perhaps because you are a newcomer or
|
||||
even maybe not a terribly experienced developer, here's our advice:
|
||||
|
||||
- Read through this document to get a grasp on a general approach to use
|
||||
- Consider adding a test case for something not currently tested (correctly)
|
||||
- Consider updating or adding documentation
|
||||
- One way to get started gently in the project, is to participate in an
|
||||
existing issue/PR and help out by reproducing the issue, review the code in
|
||||
the PR etc.
|
||||
|
||||
## Help wanted
|
||||
|
||||
In the issue tracker we occasionally mark bugs with [help
|
||||
wanted](https://github.com/curl/curl/labels/help%20wanted), as a sign that the
|
||||
bug is acknowledged to exist and that there is nobody known to work on this
|
||||
issue for the moment. Those are bugs that are fine to "grab" and provide a
|
||||
pull request for. The complexity level of these of course varies, so pick one
|
||||
that piques your interest.
|
||||
|
||||
## Work on known bugs
|
||||
|
||||
Some bugs are known and have not yet received attention and work enough to get
|
||||
fixed. We collect such known existing flaws in the
|
||||
[KNOWN_BUGS](https://curl.se/docs/knownbugs.html) page. Many of them link
|
||||
to the original bug report with some additional details, but some may also
|
||||
have aged a bit and may require some verification that the bug still exists in
|
||||
the same way and that what was said about it in the past is still valid.
|
||||
|
||||
## Fix autobuild problems
|
||||
|
||||
On the [autobuilds page](https://curl.se/dev/builds.html) we show a
|
||||
collection of test results from the automatic curl build and tests that are
|
||||
performed by volunteers. Fixing compiler warnings and errors shown there is
|
||||
something we value greatly. Also, if you own or run systems or architectures
|
||||
that are not already tested in the autobuilds, we also appreciate more
|
||||
volunteers running builds automatically to help us keep curl portable.
|
||||
|
||||
## TODO items
|
||||
|
||||
Ideas for features and functions that we have considered worthwhile to
|
||||
implement and provide are kept in the
|
||||
[TODO](https://curl.se/docs/todo.html) file. Some of the ideas are
|
||||
rough. Some are well thought out. Some probably are not really suitable
|
||||
anymore.
|
||||
|
||||
Before you invest a lot of time on a TODO item, do bring it up for discussion
|
||||
on the mailing list. For discussion on applicability but also for ideas and
|
||||
brainstorming on specific ways to do the implementation etc.
|
||||
|
||||
## You decide
|
||||
|
||||
You can also come up with a completely new thing you think we should do. Or
|
||||
not do. Or fix. Or add to the project. You then either bring it to the mailing
|
||||
list first to see if people shoot down the idea at once, or you bring a first
|
||||
draft of the idea as a pull request and take the discussion there around the
|
||||
specific implementation. Either way is fine.
|
||||
|
||||
## CONTRIBUTE
|
||||
|
||||
We offer [guidelines](https://curl.se/dev/contribute.html) that are suitable
|
||||
to be familiar with before you decide to contribute to curl. If you are used
|
||||
to open source development, you probably do not find many surprises there.
|
||||
@@ -1,486 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
How curl Became Like This
|
||||
=========================
|
||||
|
||||
Towards the end of 1996, Daniel Stenberg was spending time writing an IRC bot
|
||||
for an Amiga related channel on EFnet. He then came up with the idea to make
|
||||
currency-exchange calculations available to Internet Relay Chat (IRC)
|
||||
users. All the necessary data were published on the Web; he just needed to
|
||||
automate their retrieval.
|
||||
|
||||
1996
|
||||
----
|
||||
|
||||
On November 11, 1996 the Brazilian developer Rafael Sagula wrote and released
|
||||
HttpGet version 0.1.
|
||||
|
||||
Daniel extended this existing command-line open-source tool. After a few minor
|
||||
adjustments, it did just what he needed. The first release with Daniel's
|
||||
additions was 0.2, released on December 17, 1996. Daniel quickly became the
|
||||
new maintainer of the project.
|
||||
|
||||
1997
|
||||
----
|
||||
|
||||
HttpGet 0.3 was released in January 1997 and now it accepted HTTP URLs on the
|
||||
command line.
|
||||
|
||||
HttpGet 1.0 was released on April 8 1997 with brand new HTTP proxy support.
|
||||
|
||||
We soon found and fixed support for getting currencies over GOPHER. Once FTP
|
||||
download support was added, the name of the project was changed and urlget 2.0
|
||||
was released in August 1997. The http-only days were already passed.
|
||||
|
||||
Version 2.2 was released on August 14 1997 and introduced support to build for
|
||||
and run on Windows and Solaris.
|
||||
|
||||
November 24 1997: Version 3.1 added FTP upload support.
|
||||
|
||||
Version 3.5 added support for HTTP POST.
|
||||
|
||||
1998
|
||||
----
|
||||
|
||||
February 4: urlget 3.10
|
||||
|
||||
February 9: urlget 3.11
|
||||
|
||||
March 14: urlget 3.12 added proxy authentication.
|
||||
|
||||
The project slowly grew bigger. With upload capabilities, the name was once
|
||||
again misleading and a second name change was made. On March 20, 1998 curl 4
|
||||
was released. (The version numbering from the previous names was kept.)
|
||||
|
||||
(Unrelated to this project a company called Curl Corporation registered a US
|
||||
trademark on the name "CURL" on May 18 1998. That company had then already
|
||||
registered the curl.com domain back in November of the previous year. All this
|
||||
was revealed to us much later.)
|
||||
|
||||
SSL support was added, powered by the SSLeay library.
|
||||
|
||||
August: first announcement of curl on freshmeat.net.
|
||||
|
||||
October: with the curl 4.9 release and the introduction of cookie support,
|
||||
curl was no longer released under the GPL license. Now we are at 4000 lines of
|
||||
code, we switched over to the MPL license to restrict the effects of
|
||||
"copyleft".
|
||||
|
||||
November: configure script and reported successful compiles on several
|
||||
major operating systems. The never-quite-understood -F option was added and
|
||||
curl could now simulate quite a lot of a browser. TELNET support was added.
|
||||
|
||||
curl 5 was released in December 1998 and introduced the first ever curl man
|
||||
page. People started making Linux RPM packages out of it.
|
||||
|
||||
1999
|
||||
----
|
||||
|
||||
January: DICT support added.
|
||||
|
||||
OpenSSL took over and SSLeay was abandoned.
|
||||
|
||||
May: first Debian package.
|
||||
|
||||
August: LDAP:// and FILE:// support added. The curl website gets 1300 visits
|
||||
weekly. Moved site to curl.haxx.nu.
|
||||
|
||||
September: Released curl 6.0. 15000 lines of code.
|
||||
|
||||
December 28: added the project on Sourceforge and started using its services
|
||||
for managing the project.
|
||||
|
||||
2000
|
||||
----
|
||||
|
||||
Spring: major internal overhaul to provide a suitable library interface.
|
||||
The first non-beta release was named 7.1 and arrived in August. This offered
|
||||
the easy interface and turned out to be the beginning of actually getting
|
||||
other software and programs to be based on and powered by libcurl. Almost
|
||||
20000 lines of code.
|
||||
|
||||
June: the curl site moves to "curl.haxx.se"
|
||||
|
||||
August, the curl website gets 4000 visits weekly.
|
||||
|
||||
The PHP guys adopted libcurl already the same month, when the first ever third
|
||||
party libcurl binding showed up. CURL has been a supported module in PHP since
|
||||
the release of PHP 4.0.2. This would soon get followers. More than 16
|
||||
different bindings exist at the time of this writing.
|
||||
|
||||
September: kerberos4 support was added.
|
||||
|
||||
November: started the work on a test suite for curl. It was later re-written
|
||||
from scratch again. The libcurl major SONAME number was set to 1.
|
||||
|
||||
2001
|
||||
----
|
||||
|
||||
January: Daniel released curl 7.5.2 under a new license again: MIT (or
|
||||
MPL). The MIT license is extremely liberal and can be combined with GPL
|
||||
in other projects. This would finally put an end to the "complaints" from
|
||||
people involved in GPLed projects that previously were prohibited from using
|
||||
libcurl while it was released under MPL only. (Due to the fact that MPL is
|
||||
deemed "GPL incompatible".)
|
||||
|
||||
March 22: curl supports HTTP 1.1 starting with the release of 7.7. This
|
||||
also introduced libcurl's ability to do persistent connections. 24000 lines of
|
||||
code. The libcurl major SONAME number was bumped to 2 due to this overhaul.
|
||||
The first experimental ftps:// support was added.
|
||||
|
||||
August: The curl website gets 8000 visits weekly. Curl Corporation contacted
|
||||
Daniel to discuss "the name issue". After Daniel's reply, they have never
|
||||
since got back in touch again.
|
||||
|
||||
September: libcurl 7.9 introduces cookie jar and `curl_formadd()`. During the
|
||||
forthcoming 7.9.x releases, we introduced the multi interface slowly and
|
||||
without many whistles.
|
||||
|
||||
September 25: curl (7.7.2) is bundled in Mac OS X (10.1) for the first time. It was
|
||||
already becoming more and more of a standard utility of Linux distributions
|
||||
and a regular in the BSD ports collections.
|
||||
|
||||
2002
|
||||
----
|
||||
|
||||
June: the curl website gets 13000 visits weekly. curl and libcurl is
|
||||
35000 lines of code. Reported successful compiles on more than 40 combinations
|
||||
of CPUs and operating systems.
|
||||
|
||||
To estimate the number of users of the curl tool or libcurl library is next to
|
||||
impossible. Around 5000 downloaded packages each week from the main site gives
|
||||
a hint, but the packages are mirrored extensively, bundled with numerous OS
|
||||
distributions and otherwise retrieved as part of other software.
|
||||
|
||||
October 1: with the release of curl 7.10 it is released under the MIT license
|
||||
only.
|
||||
|
||||
Starting with 7.10, curl verifies SSL server certificates by default.
|
||||
|
||||
2003
|
||||
----
|
||||
|
||||
January: Started working on the distributed curl tests. The autobuilds.
|
||||
|
||||
February: the curl site averages at 20000 visits weekly. At any given moment,
|
||||
there is an average of 3 people browsing the website.
|
||||
|
||||
Multiple new authentication schemes are supported: Digest (May), NTLM (June)
|
||||
and Negotiate (June).
|
||||
|
||||
November: curl 7.10.8 is released. 45000 lines of code. ~55000 unique visitors
|
||||
to the website. Five official web mirrors.
|
||||
|
||||
December: full-fledged SSL for FTP is supported.
|
||||
|
||||
2004
|
||||
----
|
||||
|
||||
January: curl 7.11.0 introduced large file support.
|
||||
|
||||
June: curl 7.12.0 introduced IDN support. 10 official web mirrors.
|
||||
|
||||
This release bumped the major SONAME to 3 due to the removal of the
|
||||
`curl_formparse()` function
|
||||
|
||||
August: curl and libcurl 7.12.1
|
||||
|
||||
Public curl release number: 82
|
||||
Releases counted from the beginning: 109
|
||||
Available command line options: 96
|
||||
Available curl_easy_setopt() options: 120
|
||||
Number of public functions in libcurl: 36
|
||||
Amount of public website mirrors: 12
|
||||
Number of known libcurl bindings: 26
|
||||
|
||||
2005
|
||||
----
|
||||
|
||||
April: GnuTLS can now optionally be used for the secure layer when curl is
|
||||
built.
|
||||
|
||||
April: Added the multi_socket() API
|
||||
|
||||
September: TFTP support was added.
|
||||
|
||||
More than 100,000 unique visitors of the curl website. 25 mirrors.
|
||||
|
||||
December: security vulnerability: libcurl URL Buffer Overflow
|
||||
|
||||
2006
|
||||
----
|
||||
|
||||
January: We dropped support for Gopher. We found bugs in the implementation
|
||||
that turned out to have been introduced years ago, so with the conclusion that
|
||||
nobody had found out in all this time we removed it instead of fixing it.
|
||||
|
||||
March: security vulnerability: libcurl TFTP Packet Buffer Overflow
|
||||
|
||||
September: The major SONAME number for libcurl was bumped to 4 due to the
|
||||
removal of ftp third party transfer support.
|
||||
|
||||
November: Added SCP and SFTP support
|
||||
|
||||
2007
|
||||
----
|
||||
|
||||
February: Added support for the Mozilla NSS library to do the SSL/TLS stuff
|
||||
|
||||
July: security vulnerability: libcurl GnuTLS insufficient cert verification
|
||||
|
||||
2008
|
||||
----
|
||||
|
||||
November:
|
||||
|
||||
Command line options: 128
|
||||
curl_easy_setopt() options: 158
|
||||
Public functions in libcurl: 58
|
||||
Known libcurl bindings: 37
|
||||
Contributors: 683
|
||||
|
||||
145,000 unique visitors. >100 GB downloaded.
|
||||
|
||||
2009
|
||||
----
|
||||
|
||||
March: security vulnerability: libcurl Arbitrary File Access
|
||||
|
||||
April: added CMake support
|
||||
|
||||
August: security vulnerability: libcurl embedded zero in cert name
|
||||
|
||||
December: Added support for IMAP, POP3 and SMTP
|
||||
|
||||
2010
|
||||
----
|
||||
|
||||
January: Added support for RTSP
|
||||
|
||||
February: security vulnerability: libcurl data callback excessive length
|
||||
|
||||
March: The project switched over to use git (hosted by GitHub) instead of CVS
|
||||
for source code control
|
||||
|
||||
May: Added support for RTMP
|
||||
|
||||
Added support for PolarSSL to do the SSL/TLS stuff
|
||||
|
||||
August:
|
||||
|
||||
Public curl releases: 117
|
||||
Command line options: 138
|
||||
curl_easy_setopt() options: 180
|
||||
Public functions in libcurl: 58
|
||||
Known libcurl bindings: 39
|
||||
Contributors: 808
|
||||
|
||||
Gopher support added (re-added actually, see January 2006)
|
||||
|
||||
2011
|
||||
----
|
||||
|
||||
February: added support for the axTLS backend
|
||||
|
||||
April: added the cyassl backend (later renamed to wolfSSL)
|
||||
|
||||
2012
|
||||
----
|
||||
|
||||
July: Added support for Schannel (native Windows TLS backend) and Darwin SSL
|
||||
(Native Mac OS X and iOS TLS backend).
|
||||
|
||||
Supports Metalink
|
||||
|
||||
October: SSH-agent support.
|
||||
|
||||
2013
|
||||
----
|
||||
|
||||
February: Cleaned up internals to always uses the "multi" non-blocking
|
||||
approach internally and only expose the blocking API with a wrapper.
|
||||
|
||||
September: First small steps on supporting HTTP/2 with nghttp2.
|
||||
|
||||
October: Removed krb4 support.
|
||||
|
||||
December: Happy eyeballs.
|
||||
|
||||
2014
|
||||
----
|
||||
|
||||
March: first real release supporting HTTP/2
|
||||
|
||||
September: Website had 245,000 unique visitors and served 236GB data
|
||||
|
||||
SMB and SMBS support
|
||||
|
||||
2015
|
||||
----
|
||||
|
||||
June: support for multiplexing with HTTP/2
|
||||
|
||||
August: support for HTTP/2 server push
|
||||
|
||||
December: Public Suffix List
|
||||
|
||||
2016
|
||||
----
|
||||
|
||||
January: the curl tool defaults to HTTP/2 for HTTPS URLs
|
||||
|
||||
December: curl 7.52.0 introduced support for HTTPS-proxy
|
||||
|
||||
First TLS 1.3 support
|
||||
|
||||
2017
|
||||
----
|
||||
|
||||
July: OSS-Fuzz started fuzzing libcurl
|
||||
|
||||
September: Added MultiSSL support
|
||||
|
||||
The website serves 3100 GB/month
|
||||
|
||||
Public curl releases: 169
|
||||
Command line options: 211
|
||||
curl_easy_setopt() options: 249
|
||||
Public functions in libcurl: 74
|
||||
Contributors: 1609
|
||||
|
||||
October: SSLKEYLOGFILE support, new MIME API
|
||||
|
||||
October: Daniel received the Polhem Prize for his work on curl
|
||||
|
||||
November: brotli
|
||||
|
||||
2018
|
||||
----
|
||||
|
||||
January: new SSH backend powered by libssh
|
||||
|
||||
March: starting with the 1803 release of Windows 10, curl is shipped bundled
|
||||
with Microsoft's operating system.
|
||||
|
||||
July: curl shows headers using bold type face
|
||||
|
||||
October: added DNS-over-HTTPS (DoH) and the URL API
|
||||
|
||||
MesaLink is a new supported TLS backend
|
||||
|
||||
libcurl now does HTTP/2 (and multiplexing) by default on HTTPS URLs
|
||||
|
||||
curl and libcurl are installed in an estimated 5 *billion* instances
|
||||
world-wide.
|
||||
|
||||
October 31: curl and libcurl 7.62.0
|
||||
|
||||
Public curl releases: 177
|
||||
Command line options: 219
|
||||
curl_easy_setopt() options: 261
|
||||
Public functions in libcurl: 80
|
||||
Contributors: 1808
|
||||
|
||||
December: removed axTLS support
|
||||
|
||||
2019
|
||||
----
|
||||
|
||||
March: added experimental alt-svc support
|
||||
|
||||
August: the first HTTP/3 requests with curl.
|
||||
|
||||
September: 7.66.0 is released and the tool offers parallel downloads
|
||||
|
||||
2020
|
||||
----
|
||||
|
||||
curl and libcurl are installed in an estimated 10 *billion* instances
|
||||
world-wide.
|
||||
|
||||
January: added BearSSL support
|
||||
|
||||
March: removed support for PolarSSL, added wolfSSH support
|
||||
|
||||
April: experimental MQTT support
|
||||
|
||||
August: zstd support
|
||||
|
||||
November: the website moves to curl.se. The website serves 10TB data monthly.
|
||||
|
||||
December: alt-svc support
|
||||
|
||||
2021
|
||||
----
|
||||
|
||||
February 3: curl 7.75.0 ships with support for Hyper as an HTTP backend
|
||||
|
||||
March 31: curl 7.76.0 ships with support for Rustls
|
||||
|
||||
July: HSTS is supported
|
||||
|
||||
2022
|
||||
----
|
||||
|
||||
March: added --json, removed mesalink support
|
||||
|
||||
Public curl releases: 206
|
||||
Command line options: 245
|
||||
curl_easy_setopt() options: 295
|
||||
Public functions in libcurl: 86
|
||||
Contributors: 2601
|
||||
|
||||
The curl.se website serves 16,500 GB/month over 462M requests, the
|
||||
official docker image has been pulled 4,098,015,431 times.
|
||||
|
||||
October: initial WebSocket support
|
||||
|
||||
2023
|
||||
----
|
||||
|
||||
March: remove support for curl_off_t < 8 bytes
|
||||
|
||||
March 31: we started working on a new command line tool for URL parsing and
|
||||
manipulations: trurl.
|
||||
|
||||
May: added support for HTTP/2 over HTTPS proxy. Refuse to resolve .onion.
|
||||
|
||||
August: Dropped support for the NSS library
|
||||
|
||||
September: added "variable" support in the command line tool. Dropped support
|
||||
for the gskit TLS library.
|
||||
|
||||
October: added support for IPFS via HTTP gateway
|
||||
|
||||
December: HTTP/3 support with ngtcp2 is no longer experimental
|
||||
|
||||
2024
|
||||
----
|
||||
|
||||
January: switched to "curldown" for all documentation
|
||||
|
||||
April 24: the curl container has been pulled more than six billion times
|
||||
|
||||
May: experimental support for ECH, dropped NTLM_WB
|
||||
|
||||
August 9: we adopted the wcurl tool into the curl organization
|
||||
|
||||
September 11: --help [option]
|
||||
|
||||
November 6: TLS 1.3 early data, WebSocket is official
|
||||
|
||||
December 21: dropped hyper
|
||||
|
||||
2025
|
||||
----
|
||||
|
||||
February 5: first 0RTT for QUIC, ssl session import/export
|
||||
|
||||
February: experimental HTTPS RR support
|
||||
|
||||
February 22: The website served 62.95 TB/month; 12.43 billion requests
|
||||
The docker image has been pulled 6373501745 times.
|
||||
@@ -1,48 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# HSTS support
|
||||
|
||||
HTTP Strict-Transport-Security. Added as experimental in curl
|
||||
7.74.0. Supported "for real" since 7.77.0.
|
||||
|
||||
## Standard
|
||||
|
||||
[HTTP Strict Transport Security](https://datatracker.ietf.org/doc/html/rfc6797)
|
||||
|
||||
## Behavior
|
||||
|
||||
libcurl features an in-memory cache for HSTS hosts, so that subsequent
|
||||
HTTP-only requests to a hostname present in the cache gets internally
|
||||
"redirected" to the HTTPS version.
|
||||
|
||||
## `curl_easy_setopt()` options:
|
||||
|
||||
- `CURLOPT_HSTS_CTRL` - enable HSTS for this easy handle
|
||||
- `CURLOPT_HSTS` - specify filename where to store the HSTS cache on close
|
||||
(and possibly read from at startup)
|
||||
|
||||
## curl command line options
|
||||
|
||||
- `--hsts [filename]` - enable HSTS, use the file as HSTS cache. If filename
|
||||
is `""` (no length) then no file is used, only in-memory cache.
|
||||
|
||||
## HSTS cache file format
|
||||
|
||||
Lines starting with `#` are ignored.
|
||||
|
||||
For each hsts entry:
|
||||
|
||||
[host name] "YYYYMMDD HH:MM:SS"
|
||||
|
||||
The `[host name]` is dot-prefixed if it includes subdomains.
|
||||
|
||||
The time stamp is when the entry expires.
|
||||
|
||||
## Possible future additions
|
||||
|
||||
- `CURLOPT_HSTS_PRELOAD` - provide a set of HSTS hostnames to load first
|
||||
- ability to save to something else than a file
|
||||
@@ -1,171 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# HTTP Cookies
|
||||
|
||||
## Cookie overview
|
||||
|
||||
Cookies are `name=contents` pairs that an HTTP server tells the client to
|
||||
hold and then the client sends back those to the server on subsequent
|
||||
requests to the same domains and paths for which the cookies were set.
|
||||
|
||||
Cookies are either "session cookies" which typically are forgotten when the
|
||||
session is over which is often translated to equal when browser quits, or
|
||||
the cookies are not session cookies they have expiration dates after which
|
||||
the client throws them away.
|
||||
|
||||
Cookies are set to the client with the Set-Cookie: header and are sent to
|
||||
servers with the Cookie: header.
|
||||
|
||||
For a long time, the only spec explaining how to use cookies was the
|
||||
original [Netscape spec from 1994](https://curl.se/rfc/cookie_spec.html).
|
||||
|
||||
In 2011, [RFC 6265](https://www.ietf.org/rfc/rfc6265.txt) was finally
|
||||
published and details how cookies work within HTTP. In 2016, an update which
|
||||
added support for prefixes was
|
||||
[proposed](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00),
|
||||
and in 2017, another update was
|
||||
[drafted](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-alone-01)
|
||||
to deprecate modification of 'secure' cookies from non-secure origins. Both
|
||||
of these drafts have been incorporated into a proposal to
|
||||
[replace](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-11)
|
||||
RFC 6265. Cookie prefixes and secure cookie modification protection has been
|
||||
implemented by curl.
|
||||
|
||||
curl considers `http://localhost` to be a *secure context*, meaning that it
|
||||
allows and uses cookies marked with the `secure` keyword even when done over
|
||||
plain HTTP for this host. curl does this to match how popular browsers work
|
||||
with secure cookies.
|
||||
|
||||
## Super cookies
|
||||
|
||||
A single cookie can be set for a domain that matches multiple hosts. Like if
|
||||
set for `example.com` it gets sent to both `aa.example.com` as well as
|
||||
`bb.example.com`.
|
||||
|
||||
A challenge with this concept is that there are certain domains for which
|
||||
cookies should not be allowed at all, because they are *Public
|
||||
Suffixes*. Similarly, a client never accepts cookies set directly for the
|
||||
top-level domain like for example `.com`. Cookies set for *too broad*
|
||||
domains are generally referred to as *super cookies*.
|
||||
|
||||
If curl is built with PSL (**Public Suffix List**) support, it detects and
|
||||
discards cookies that are specified for such suffix domains that should not
|
||||
be allowed to have cookies.
|
||||
|
||||
if curl is *not* built with PSL support, it has no ability to stop super
|
||||
cookies.
|
||||
|
||||
## Cookies saved to disk
|
||||
|
||||
Netscape once created a file format for storing cookies on disk so that they
|
||||
would survive browser restarts. curl adopted that file format to allow
|
||||
sharing the cookies with browsers, only to see browsers move away from that
|
||||
format. Modern browsers no longer use it, while curl still does.
|
||||
|
||||
The Netscape cookie file format stores one cookie per physical line in the
|
||||
file with a bunch of associated meta data, each field separated with
|
||||
TAB. That file is called the cookie jar in curl terminology.
|
||||
|
||||
When libcurl saves a cookie jar, it creates a file header of its own in
|
||||
which there is a URL mention that links to the web version of this document.
|
||||
|
||||
## Cookie file format
|
||||
|
||||
The cookie file format is text based and stores one cookie per line. Lines
|
||||
that start with `#` are treated as comments. An exception is lines that
|
||||
start with `#HttpOnly_`, which is a prefix for cookies that have the
|
||||
`HttpOnly` attribute set.
|
||||
|
||||
Each line that specifies a single cookie consists of seven text fields
|
||||
separated with TAB characters. A valid line must end with a newline
|
||||
character.
|
||||
|
||||
### Fields in the file
|
||||
|
||||
Field number, what type and example data and the meaning of it:
|
||||
|
||||
0. string `example.com` - the domain name
|
||||
1. boolean `FALSE` - include subdomains
|
||||
2. string `/foobar/` - path
|
||||
3. boolean `TRUE` - send/receive over HTTPS only
|
||||
4. number `1462299217` - expires at - seconds since Jan 1st 1970, or 0
|
||||
5. string `person` - name of the cookie
|
||||
6. string `daniel` - value of the cookie
|
||||
|
||||
## Cookies with curl the command line tool
|
||||
|
||||
curl has a full cookie "engine" built in. If you just activate it, you can
|
||||
have curl receive and send cookies exactly as mandated in the specs.
|
||||
|
||||
Command line options:
|
||||
|
||||
[`-b, --cookie`](https://curl.se/docs/manpage.html#-b)
|
||||
|
||||
tell curl a file to read cookies from and start the cookie engine, or if it
|
||||
is not a file it passes on the given string. `-b name=var` works and so does
|
||||
`-b cookiefile`.
|
||||
|
||||
[`-j, --junk-session-cookies`](https://curl.se/docs/manpage.html#-j)
|
||||
|
||||
when used in combination with -b, it skips all "session cookies" on load so
|
||||
as to appear to start a new cookie session.
|
||||
|
||||
[`-c, --cookie-jar`](https://curl.se/docs/manpage.html#-c)
|
||||
|
||||
tell curl to start the cookie engine and write cookies to the given file
|
||||
after the request(s)
|
||||
|
||||
## Cookies with libcurl
|
||||
|
||||
libcurl offers several ways to enable and interface the cookie engine. These
|
||||
options are the ones provided by the native API. libcurl bindings may offer
|
||||
access to them using other means.
|
||||
|
||||
[`CURLOPT_COOKIE`](https://curl.se/libcurl/c/CURLOPT_COOKIE.html)
|
||||
|
||||
Is used when you want to specify the exact contents of a cookie header to
|
||||
send to the server.
|
||||
|
||||
[`CURLOPT_COOKIEFILE`](https://curl.se/libcurl/c/CURLOPT_COOKIEFILE.html)
|
||||
|
||||
Tell libcurl to activate the cookie engine, and to read the initial set of
|
||||
cookies from the given file. Read-only.
|
||||
|
||||
[`CURLOPT_COOKIEJAR`](https://curl.se/libcurl/c/CURLOPT_COOKIEJAR.html)
|
||||
|
||||
Tell libcurl to activate the cookie engine, and when the easy handle is
|
||||
closed save all known cookies to the given cookie jar file. Write-only.
|
||||
|
||||
[`CURLOPT_COOKIELIST`](https://curl.se/libcurl/c/CURLOPT_COOKIELIST.html)
|
||||
|
||||
Provide detailed information about a single cookie to add to the internal
|
||||
storage of cookies. Pass in the cookie as an HTTP header with all the
|
||||
details set, or pass in a line from a Netscape cookie file. This option can
|
||||
also be used to flush the cookies etc.
|
||||
|
||||
[`CURLOPT_COOKIESESSION`](https://curl.se/libcurl/c/CURLOPT_COOKIESESSION.html)
|
||||
|
||||
Tell libcurl to ignore all cookies it is about to load that are session
|
||||
cookies.
|
||||
|
||||
[`CURLINFO_COOKIELIST`](https://curl.se/libcurl/c/CURLINFO_COOKIELIST.html)
|
||||
|
||||
Extract cookie information from the internal cookie storage as a linked
|
||||
list.
|
||||
|
||||
## Cookies with JavaScript
|
||||
|
||||
These days a lot of the web is built up by JavaScript. The web browser loads
|
||||
complete programs that render the page you see. These JavaScript programs
|
||||
can also set and access cookies.
|
||||
|
||||
Since curl and libcurl are plain HTTP clients without any knowledge of or
|
||||
capability to handle JavaScript, such cookies are not detected or used.
|
||||
|
||||
Often, if you want to mimic what a browser does on such websites, you can
|
||||
record web browser HTTP traffic when using such a site and then repeat the
|
||||
cookie operations using curl or libcurl.
|
||||
@@ -1,481 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# HTTP3 (and QUIC)
|
||||
|
||||
## Resources
|
||||
|
||||
[HTTP/3 Explained](https://http3-explained.haxx.se/en/) - the online free
|
||||
book describing the protocols involved.
|
||||
|
||||
[quicwg.org](https://quicwg.org/) - home of the official protocol drafts
|
||||
|
||||
## QUIC libraries
|
||||
|
||||
QUIC libraries we are using:
|
||||
|
||||
[ngtcp2](https://github.com/ngtcp2/ngtcp2)
|
||||
|
||||
[quiche](https://github.com/cloudflare/quiche) - **EXPERIMENTAL**
|
||||
|
||||
[OpenSSL 3.2+ QUIC](https://github.com/openssl/openssl) - **EXPERIMENTAL**
|
||||
|
||||
[msh3](https://github.com/nibanks/msh3) (with [msquic](https://github.com/microsoft/msquic)) - **EXPERIMENTAL**
|
||||
|
||||
## Experimental
|
||||
|
||||
HTTP/3 support in curl is considered **EXPERIMENTAL** until further notice
|
||||
when built to use *quiche* or *msh3*. Only the *ngtcp2* backend is not
|
||||
experimental.
|
||||
|
||||
Further development and tweaking of the HTTP/3 support in curl happens in the
|
||||
master branch using pull-requests, just like ordinary changes.
|
||||
|
||||
To fix before we remove the experimental label:
|
||||
|
||||
- the used QUIC library needs to consider itself non-beta
|
||||
- it is fine to "leave" individual backends as experimental if necessary
|
||||
|
||||
# ngtcp2 version
|
||||
|
||||
Building curl with ngtcp2 involves 3 components: `ngtcp2` itself, `nghttp3` and a QUIC supporting TLS library. The supported TLS libraries are covered below.
|
||||
|
||||
While any version of `ngtcp2` and `nghttp3` from v1.0.0 on are expected to
|
||||
work, using the latest versions often brings functional and performance
|
||||
improvements.
|
||||
|
||||
The build examples use `$NGHTTP3_VERSION` and `$NGTCP2_VERSION` as placeholders
|
||||
for the version you build.
|
||||
|
||||
## Build with OpenSSL
|
||||
|
||||
OpenSSL v3.5.0+ offers APIs for integration with *ngtcp2* v1.12.0+. Earlier
|
||||
versions do not work.
|
||||
|
||||
Build OpenSSL (version 3.5.0 or newer):
|
||||
|
||||
% git clone --quiet --depth=1 -b openssl-$OPENSSL_VERSION https://github.com/openssl/openssl
|
||||
% cd openssl
|
||||
% ./config --prefix=<somewhere1> --libdir=lib
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build nghttp3:
|
||||
|
||||
% cd ..
|
||||
% git clone -b $NGHTTP3_VERSION https://github.com/ngtcp2/nghttp3
|
||||
% cd nghttp3
|
||||
% git submodule update --init
|
||||
% autoreconf -fi
|
||||
% ./configure --prefix=<somewhere2> --enable-lib-only
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build ngtcp2:
|
||||
|
||||
% cd ..
|
||||
% git clone -b $NGTCP2_VERSION https://github.com/ngtcp2/ngtcp2
|
||||
% cd ngtcp2
|
||||
% autoreconf -fi
|
||||
% ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only --with-openssl
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build curl:
|
||||
|
||||
% cd ..
|
||||
% git clone https://github.com/curl/curl
|
||||
% cd curl
|
||||
% autoreconf -fi
|
||||
% LDFLAGS="-Wl,-rpath,<somewhere1>/lib" ./configure --with-openssl=<somewhere1> --with-nghttp3=<somewhere2> --with-ngtcp2=<somewhere3>
|
||||
% make
|
||||
% make install
|
||||
|
||||
## Build with quictls
|
||||
|
||||
OpenSSL does not offer the required APIs for building a QUIC client. You need
|
||||
to use a TLS library that has such APIs and that works with *ngtcp2*.
|
||||
|
||||
Build quictls (any `+quic` tagged version works):
|
||||
|
||||
% git clone --depth 1 -b openssl-3.1.4+quic https://github.com/quictls/openssl
|
||||
% cd openssl
|
||||
% ./config enable-tls1_3 --prefix=<somewhere1> --libdir=lib
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build nghttp3:
|
||||
|
||||
% cd ..
|
||||
% git clone -b $NGHTTP3_VERSION https://github.com/ngtcp2/nghttp3
|
||||
% cd nghttp3
|
||||
% git submodule update --init
|
||||
% autoreconf -fi
|
||||
% ./configure --prefix=<somewhere2> --enable-lib-only
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build ngtcp2:
|
||||
|
||||
% cd ..
|
||||
% git clone -b $NGTCP2_VERSION https://github.com/ngtcp2/ngtcp2
|
||||
% cd ngtcp2
|
||||
% autoreconf -fi
|
||||
% ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build curl:
|
||||
|
||||
% cd ..
|
||||
% git clone https://github.com/curl/curl
|
||||
% cd curl
|
||||
% autoreconf -fi
|
||||
% LDFLAGS="-Wl,-rpath,<somewhere1>/lib" ./configure --with-openssl=<somewhere1> --with-nghttp3=<somewhere2> --with-ngtcp2=<somewhere3>
|
||||
% make
|
||||
% make install
|
||||
|
||||
## Build with GnuTLS
|
||||
|
||||
Build GnuTLS:
|
||||
|
||||
% git clone --depth 1 https://gitlab.com/gnutls/gnutls.git
|
||||
% cd gnutls
|
||||
% ./bootstrap
|
||||
% ./configure --prefix=<somewhere1>
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build nghttp3:
|
||||
|
||||
% cd ..
|
||||
% git clone -b $NGHTTP3_VERSION https://github.com/ngtcp2/nghttp3
|
||||
% cd nghttp3
|
||||
% git submodule update --init
|
||||
% autoreconf -fi
|
||||
% ./configure --prefix=<somewhere2> --enable-lib-only
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build ngtcp2:
|
||||
|
||||
% cd ..
|
||||
% git clone -b $NGTCP2_VERSION https://github.com/ngtcp2/ngtcp2
|
||||
% cd ngtcp2
|
||||
% autoreconf -fi
|
||||
% ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only --with-gnutls
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build curl:
|
||||
|
||||
% cd ..
|
||||
% git clone https://github.com/curl/curl
|
||||
% cd curl
|
||||
% autoreconf -fi
|
||||
% ./configure --with-gnutls=<somewhere1> --with-nghttp3=<somewhere2> --with-ngtcp2=<somewhere3>
|
||||
% make
|
||||
% make install
|
||||
|
||||
## Build with wolfSSL
|
||||
|
||||
Build wolfSSL:
|
||||
|
||||
% git clone https://github.com/wolfSSL/wolfssl.git
|
||||
% cd wolfssl
|
||||
% autoreconf -fi
|
||||
% ./configure --prefix=<somewhere1> --enable-quic --enable-session-ticket --enable-earlydata --enable-psk --enable-harden --enable-altcertchains
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build nghttp3:
|
||||
|
||||
% cd ..
|
||||
% git clone -b $NGHTTP3_VERSION https://github.com/ngtcp2/nghttp3
|
||||
% cd nghttp3
|
||||
% git submodule update --init
|
||||
% autoreconf -fi
|
||||
% ./configure --prefix=<somewhere2> --enable-lib-only
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build ngtcp2:
|
||||
|
||||
% cd ..
|
||||
% git clone -b $NGTCP2_VERSION https://github.com/ngtcp2/ngtcp2
|
||||
% cd ngtcp2
|
||||
% autoreconf -fi
|
||||
% ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only --with-wolfssl
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build curl:
|
||||
|
||||
% cd ..
|
||||
% git clone https://github.com/curl/curl
|
||||
% cd curl
|
||||
% autoreconf -fi
|
||||
% ./configure --with-wolfssl=<somewhere1> --with-nghttp3=<somewhere2> --with-ngtcp2=<somewhere3>
|
||||
% make
|
||||
% make install
|
||||
|
||||
# quiche version
|
||||
|
||||
quiche support is **EXPERIMENTAL**
|
||||
|
||||
Since the quiche build manages its dependencies, curl can be built against the latest version. You are *probably* able to build against their main branch, but in case of problems, we recommend their latest release tag.
|
||||
|
||||
## Build
|
||||
|
||||
Build quiche and BoringSSL:
|
||||
|
||||
% git clone --recursive -b 0.22.0 https://github.com/cloudflare/quiche
|
||||
% cd quiche
|
||||
% cargo build --package quiche --release --features ffi,pkg-config-meta,qlog
|
||||
% ln -s libquiche.so target/release/libquiche.so.0
|
||||
% mkdir quiche/deps/boringssl/src/lib
|
||||
% ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/
|
||||
|
||||
Build curl:
|
||||
|
||||
% cd ..
|
||||
% git clone https://github.com/curl/curl
|
||||
% cd curl
|
||||
% autoreconf -fi
|
||||
% ./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche/target/release" --with-openssl=$PWD/../quiche/quiche/deps/boringssl/src --with-quiche=$PWD/../quiche/target/release
|
||||
% make
|
||||
% make install
|
||||
|
||||
If `make install` results in `Permission denied` error, you need to prepend
|
||||
it with `sudo`.
|
||||
|
||||
# OpenSSL version
|
||||
|
||||
QUIC support is **EXPERIMENTAL**
|
||||
|
||||
Use OpenSSL 3.3.1 or newer (QUIC support was added in 3.3.0, with
|
||||
shortcomings on some platforms like macOS). 3.4.1 or newer is recommended.
|
||||
Build via:
|
||||
|
||||
% cd ..
|
||||
% git clone -b $OPENSSL_VERSION https://github.com/openssl/openssl
|
||||
% cd openssl
|
||||
% ./config enable-tls1_3 --prefix=<somewhere> --libdir=lib
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build nghttp3:
|
||||
|
||||
% cd ..
|
||||
% git clone -b $NGHTTP3_VERSION https://github.com/ngtcp2/nghttp3
|
||||
% cd nghttp3
|
||||
% git submodule update --init
|
||||
% autoreconf -fi
|
||||
% ./configure --prefix=<somewhere2> --enable-lib-only
|
||||
% make
|
||||
% make install
|
||||
|
||||
Build curl:
|
||||
|
||||
% cd ..
|
||||
% git clone https://github.com/curl/curl
|
||||
% cd curl
|
||||
% autoreconf -fi
|
||||
% LDFLAGS="-Wl,-rpath,<somewhere>/lib" ./configure --with-openssl=<somewhere> --with-openssl-quic --with-nghttp3=<somewhere2>
|
||||
% make
|
||||
% make install
|
||||
|
||||
You can build curl with cmake:
|
||||
|
||||
% cd ..
|
||||
% git clone https://github.com/curl/curl
|
||||
% cd curl
|
||||
% cmake -B bld -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON
|
||||
% cmake --build bld
|
||||
% cmake --install bld
|
||||
|
||||
If `make install` results in `Permission denied` error, you need to prepend
|
||||
it with `sudo`.
|
||||
|
||||
# msh3 (msquic) version
|
||||
|
||||
**Note**: The msquic HTTP/3 backend is immature and is not properly functional
|
||||
one as of September 2023. Feel free to help us test it and improve it, but
|
||||
there is no point in filing bugs about it just yet.
|
||||
|
||||
msh3 support is **EXPERIMENTAL**
|
||||
|
||||
## Build Linux (with quictls fork of OpenSSL)
|
||||
|
||||
Build msh3:
|
||||
|
||||
% git clone -b v0.6.0 --depth 1 --recursive https://github.com/nibanks/msh3
|
||||
% cd msh3 && mkdir build && cd build
|
||||
% cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
|
||||
% cmake --build .
|
||||
% cmake --install .
|
||||
|
||||
Build curl:
|
||||
|
||||
% git clone https://github.com/curl/curl
|
||||
% cd curl
|
||||
% autoreconf -fi
|
||||
% ./configure LDFLAGS="-Wl,-rpath,/usr/local/lib" --with-msh3=/usr/local --with-openssl
|
||||
% make
|
||||
% make install
|
||||
|
||||
Run from `/usr/local/bin/curl`.
|
||||
|
||||
## Build Windows
|
||||
|
||||
Build msh3:
|
||||
|
||||
% git clone -b v0.6.0 --depth 1 --recursive https://github.com/nibanks/msh3
|
||||
% cd msh3 && mkdir build && cd build
|
||||
% cmake -G 'Visual Studio 17 2022' -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
|
||||
% cmake --build . --config Release
|
||||
% cmake --install . --config Release
|
||||
|
||||
**Note** - On Windows, Schannel is used for TLS support by default. If you
|
||||
with to use (the quictls fork of) OpenSSL, specify the `-DQUIC_TLS=openssl`
|
||||
option to the generate command above. Also note that OpenSSL brings with it an
|
||||
additional set of build dependencies not specified here.
|
||||
|
||||
Build curl (in [Visual Studio Command
|
||||
prompt](../winbuild/README.md#open-a-command-prompt)):
|
||||
|
||||
% git clone https://github.com/curl/curl
|
||||
% cd curl/winbuild
|
||||
% nmake /f Makefile.vc mode=dll WITH_MSH3=dll MSH3_PATH="C:/Program Files/msh3" MACHINE=x64
|
||||
|
||||
Run in the `C:/Program Files/msh3/lib` directory, copy `curl.exe` to that
|
||||
directory, or copy `msquic.dll` and `msh3.dll` from that directory to the
|
||||
`curl.exe` directory. For example:
|
||||
|
||||
% C:\Program Files\msh3\lib> F:\curl\builds\libcurl-vc-x64-release-dll-ipv6-sspi-schannel-msh3\bin\curl.exe --http3 https://curl.se/
|
||||
|
||||
# `--http3`
|
||||
|
||||
Use only HTTP/3:
|
||||
|
||||
% curl --http3-only https://example.org:4433/
|
||||
|
||||
Use HTTP/3 with fallback to HTTP/2 or HTTP/1.1 (see "HTTPS eyeballing" below):
|
||||
|
||||
% curl --http3 https://example.org:4433/
|
||||
|
||||
Upgrade via Alt-Svc:
|
||||
|
||||
% curl --alt-svc altsvc.cache https://curl.se/
|
||||
|
||||
See this [list of public HTTP/3 servers](https://bagder.github.io/HTTP3-test/)
|
||||
|
||||
### HTTPS eyeballing
|
||||
|
||||
With option `--http3` curl attempts earlier HTTP versions as well should the
|
||||
connect attempt via HTTP/3 not succeed "fast enough". This strategy is similar
|
||||
to IPv4/6 happy eyeballing where the alternate address family is used in
|
||||
parallel after a short delay.
|
||||
|
||||
The IPv4/6 eyeballing has a default of 200ms and you may override that via
|
||||
`--happy-eyeballs-timeout-ms value`. Since HTTP/3 is still relatively new, we
|
||||
decided to use this timeout also for the HTTP eyeballing - with a slight
|
||||
twist.
|
||||
|
||||
The `happy-eyeballs-timeout-ms` value is the **hard** timeout, meaning after
|
||||
that time expired, a TLS connection is opened in addition to negotiate HTTP/2
|
||||
or HTTP/1.1. At half of that value - currently - is the **soft** timeout. The
|
||||
soft timeout fires, when there has been **no data at all** seen from the
|
||||
server on the HTTP/3 connection.
|
||||
|
||||
So, without you specifying anything, the hard timeout is 200ms and the soft is 100ms:
|
||||
|
||||
* Ideally, the whole QUIC handshake happens and curl has an HTTP/3 connection
|
||||
in less than 100ms.
|
||||
* When QUIC is not supported (or UDP does not work for this network path), no
|
||||
reply is seen and the HTTP/2 TLS+TCP connection starts 100ms later.
|
||||
* In the worst case, UDP replies start before 100ms, but drag on. This starts
|
||||
the TLS+TCP connection after 200ms.
|
||||
* When the QUIC handshake fails, the TLS+TCP connection is attempted right
|
||||
away. For example, when the QUIC server presents the wrong certificate.
|
||||
|
||||
The whole transfer only fails, when **both** QUIC and TLS+TCP fail to
|
||||
handshake or time out.
|
||||
|
||||
Note that all this happens in addition to IP version happy eyeballing. If the
|
||||
name resolution for the server gives more than one IP address, curl tries all
|
||||
those until one succeeds - just as with all other protocols. If those IP
|
||||
addresses contain both IPv6 and IPv4, those attempts happen, delayed, in
|
||||
parallel (the actual eyeballing).
|
||||
|
||||
## Known Bugs
|
||||
|
||||
Check out the [list of known HTTP3 bugs](https://curl.se/docs/knownbugs.html#HTTP3).
|
||||
|
||||
# HTTP/3 Test server
|
||||
|
||||
This is not advice on how to run anything in production. This is for
|
||||
development and experimenting.
|
||||
|
||||
## Prerequisite(s)
|
||||
|
||||
An existing local HTTP/1.1 server that hosts files. Preferably also a few huge
|
||||
ones. You can easily create huge local files like `truncate -s=8G 8GB` - they
|
||||
are huge but do not occupy that much space on disk since they are just big
|
||||
holes.
|
||||
|
||||
In a Debian setup you can install apache2. It runs on port 80 and has a
|
||||
document root in `/var/www/html`. Download the 8GB file from apache with `curl
|
||||
localhost/8GB -o dev/null`
|
||||
|
||||
In this description we setup and run an HTTP/3 reverse-proxy in front of the
|
||||
HTTP/1 server.
|
||||
|
||||
## Setup
|
||||
|
||||
You can select either or both of these server solutions.
|
||||
|
||||
### nghttpx
|
||||
|
||||
Get, build and install quictls, nghttp3 and ngtcp2 as described
|
||||
above.
|
||||
|
||||
Get, build and install nghttp2:
|
||||
|
||||
% git clone https://github.com/nghttp2/nghttp2.git
|
||||
% cd nghttp2
|
||||
% autoreconf -fi
|
||||
% PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/daniel/build-quictls/lib/pkgconfig:/home/daniel/build-nghttp3/lib/pkgconfig:/home/daniel/build-ngtcp2/lib/pkgconfig LDFLAGS=-L/home/daniel/build-quictls/lib CFLAGS=-I/home/daniel/build-quictls/include ./configure --enable-maintainer-mode --prefix=/home/daniel/build-nghttp2 --disable-shared --enable-app --enable-http3 --without-jemalloc --without-libxml2 --without-systemd
|
||||
% make && make install
|
||||
|
||||
Run the local h3 server on port 9443, make it proxy all traffic through to
|
||||
HTTP/1 on localhost port 80. For local toying, we can just use the test cert
|
||||
that exists in curl's test dir.
|
||||
|
||||
% CERT=/path/to/stunnel.pem
|
||||
% $HOME/bin/nghttpx $CERT $CERT --backend=localhost,80 \
|
||||
--frontend="localhost,9443;quic"
|
||||
|
||||
### Caddy
|
||||
|
||||
[Install Caddy](https://caddyserver.com/docs/install). For easiest use, the binary
|
||||
should be either in your PATH or your current directory.
|
||||
|
||||
Create a `Caddyfile` with the following content:
|
||||
~~~
|
||||
localhost:7443 {
|
||||
respond "Hello, world! you are using {http.request.proto}"
|
||||
}
|
||||
~~~
|
||||
|
||||
Then run Caddy:
|
||||
|
||||
% ./caddy start
|
||||
|
||||
Making requests to `https://localhost:7443` should tell you which protocol is being used.
|
||||
|
||||
You can change the hard-coded response to something more useful by replacing `respond`
|
||||
with `reverse_proxy` or `file_server`, for example: `reverse_proxy localhost:80`
|
||||
@@ -1,100 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# HTTPS RR
|
||||
|
||||
[RFC 9460](https://www.rfc-editor.org/rfc/rfc9460.html) documents the HTTPS
|
||||
DNS Resource Record.
|
||||
|
||||
curl features **experimental** support for HTTPS RR.
|
||||
|
||||
- The ALPN list from the record is parsed and used
|
||||
- The ECH field is stored - and used if ECH is enabled in the build
|
||||
- The port number is not used (Firefox supports it, Chrome does not)
|
||||
- The target name is not used
|
||||
- The IP addresses (`Ipv6hints`, `Ipv4hints`) from the HTTPS RR are not used
|
||||
- It only supports a single HTTPS RR per hostname
|
||||
- Hostnames without A/AAAA records but *with* HTTPS RR fails
|
||||
- consider service profiles where the RR provides different addresses for TCP
|
||||
vs QUIC etc
|
||||
|
||||
`HTTPSRR` is listed as a feature in the `curl -V` output if curl contains
|
||||
HTTPS RR support. If c-ares is not included in the build, the HTTPS RR support
|
||||
is limited to DoH.
|
||||
|
||||
`asyn-rr` is listed as a feature in the `curl -V` output if c-ares is used for
|
||||
additional resolves in addition to a "normal" resolve done with the threaded
|
||||
resolver.
|
||||
|
||||
The data extracted from the HTTPS RR is stored in the in-memory DNS cache to
|
||||
be reused on subsequent uses of the same hostnames.
|
||||
|
||||
## limitations
|
||||
|
||||
We have decided to work on the HTTPS RR support by following what seems to be
|
||||
(widely) used, and simply wait with implementing the details of the record
|
||||
that do not seem to be deployed. HTTPS RR is a DNS field with many odd corners
|
||||
and complexities and we might as well avoid them if no one seems to want them.
|
||||
|
||||
## build
|
||||
|
||||
./configure --enable-httpsrr
|
||||
|
||||
or
|
||||
|
||||
cmake -DUSE_HTTPSRR=ON
|
||||
|
||||
## ALPN
|
||||
|
||||
The list of ALPN IDs is parsed but may not be completely respected because of
|
||||
what the HTTP version preference is set to, which is a problem we are working
|
||||
on. Also, getting an `HTTP/1.1` ALPN in the HTTPS RR field for an HTTP://
|
||||
transfer should imply switching to HTTPS, HSTS style. Which curl currently
|
||||
does not.
|
||||
|
||||
## DoH
|
||||
|
||||
When HTTPS RR is enabled in the curl build, The DoH code asks for an HTTPS
|
||||
record in addition to the A and AAAA records, and if an HTTPS RR answer is
|
||||
returned, curl parses it and stores the retrieved information.
|
||||
|
||||
## Non-DoH
|
||||
|
||||
If DoH is not used for name resolving in an HTTPS RR enabled build, we must
|
||||
provide the ability using the regular resolver backends. We use the c-ares DNS
|
||||
library for the HTTPS RR lookup. Version 1.28.0 or later.
|
||||
|
||||
### c-ares
|
||||
|
||||
If curl is built to use the c-ares library for name resolves, an HTTPS RR
|
||||
enabled build makes a request for the HTTPS RR in addition to the regular
|
||||
lookup.
|
||||
|
||||
### Threaded resolver
|
||||
|
||||
When built to use the threaded resolver, which is the default, an HTTPS RR
|
||||
build still needs a c-ares installation provided so that a separate request
|
||||
for the HTTPS record can be done in parallel to the regular getaddrinfo()
|
||||
call.
|
||||
|
||||
This is done by specifying both c-ares and threaded resolver to configure:
|
||||
|
||||
./configure --enable-ares=... --enable-threaded-resolver
|
||||
|
||||
or to cmake:
|
||||
|
||||
cmake -DENABLE_ARES=ON -DENABLE_THREADED_RESOLVER=ON
|
||||
|
||||
Because the HTTPS record is handled separately from the A/AAAA record
|
||||
retrieval, by a separate library, there is a small risk for discrepancies.
|
||||
|
||||
When building curl using the threaded resolver with HTTPS RR support (using
|
||||
c-ares), the `curl -V` output looks exactly like a c-ares resolver build.
|
||||
|
||||
## HTTPS RR Options
|
||||
|
||||
Because curl is a low level transfer tool for which users sometimes want
|
||||
detailed control, we need to offer options to control HTTPS RR use.
|
||||
@@ -1,209 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Infrastructure in the curl project
|
||||
|
||||
Overview of infrastructure we maintain, host and run in the project for the
|
||||
project.
|
||||
|
||||
## git repository
|
||||
|
||||
Since 2010, the main curl git repository has been hosted by GitHub, available
|
||||
at https://github.com/curl/curl.
|
||||
|
||||
We also use the issue tracker, pull requests and discussions on GitHub.
|
||||
|
||||
curl has an "enterprise account" on GitHub and is an "organization" on the
|
||||
site.
|
||||
|
||||
We accept sponsorship via GitHub Sponsors.
|
||||
|
||||
## CI services
|
||||
|
||||
For every pull request and git push to the master repository, a number of
|
||||
build and testing jobs are run on a set of different CI services. The exact
|
||||
services vary over time. GitHub Actions and AppVeyor are the primary ones
|
||||
these days.
|
||||
|
||||
## Test Clutch
|
||||
|
||||
A [Test Clutch](https://github.com/dfandrich/testclutch) instance generates
|
||||
regular reports on curl CI test results at https://testclutch.curl.se/ as well
|
||||
as writing comments on curl pull requests whose tests have failed. The jobs
|
||||
are hosted on a Virtuozzo Application Platform PaaS instance and is managed by
|
||||
Dan Fandrich. The configuration code is available and managed at
|
||||
https://github.com/dfandrich/testclutch-curl-web
|
||||
|
||||
## Autobuilds
|
||||
|
||||
The curl autobuild system is a set of scripts that build and test curl and
|
||||
send all output logs back to the autobuild server. The results are
|
||||
continuously collected and visualized on the curl website at
|
||||
<https://curl.se/dev/builds.html>.
|
||||
|
||||
The autobuild system and server is maintained by Daniel Stenberg.
|
||||
|
||||
## OSS-Fuzz
|
||||
|
||||
Google runs the [OSS-Fuzz](https://google.github.io/oss-fuzz/) project which
|
||||
also runs fuzzing on curl code, non-stop, in their infrastructure and they
|
||||
send us emails in the rare instances they actually find something.
|
||||
|
||||
OSS-Fuzz notifies those that are members in the "curl team". Any curl
|
||||
maintainer who wants to is welcome to participate. It requires a Google
|
||||
account.
|
||||
|
||||
## Coverity
|
||||
|
||||
We regularly run our code through the [Coverity static code
|
||||
analyzer](https://scan.coverity.com/) thanks to them offering this service to
|
||||
us for free.
|
||||
|
||||
## CodeSonar
|
||||
|
||||
[CodeSonar](https://codesecure.com/our-products/codesonar/) analyzes the curl
|
||||
source code daily and emails Daniel Stenberg whenever it finds suspected
|
||||
problems in the source code. I hope and expect that we can invite other
|
||||
maintainers to access these reports soon.
|
||||
|
||||
## Domain names
|
||||
|
||||
The project runs services and website using a few different curl related
|
||||
domain names, including `curl.se` and `curl.dev`. Daniel Stenberg owns these
|
||||
domain names.
|
||||
|
||||
Until a few years ago, the curl website was present at `curl.haxx.se`. The
|
||||
`haxx.se` domain is owned by Haxx AB, administrated by Daniel Stenberg. The
|
||||
curl.haxx.se name is meant to keep working and be redirecting to curl.se for
|
||||
the foreseeable future.
|
||||
|
||||
## Websites
|
||||
|
||||
The main curl website at `curl.se` is maintained by curl maintainers and the
|
||||
content is available and managed at https://github.com/curl/curl-www. The site
|
||||
updates from git and runs make every 20 minutes. Any change pushed to git can
|
||||
thus take up to 20 minutes until it takes effect on the origin server.
|
||||
|
||||
The content on `curl.dev` is available and managed at
|
||||
https://github.com/curl/curl.dev/
|
||||
|
||||
The content on `everything-curl.dev` is available and managed at
|
||||
https://github.com/curl/everything-curl/
|
||||
|
||||
The machine hosting the website contents for these three sites is owned by
|
||||
Haxx AB and is primarily managed by Daniel Stenberg (co-owner of the Haxx
|
||||
company). The machine is physically located in Sweden.
|
||||
|
||||
curl release tarballs are hosted on https://curl.se/download.html. They are
|
||||
uploaded there at release-time by the release manager.
|
||||
|
||||
curl-for-win downloads are hosted on https://curl.se/windows and are uploaded
|
||||
to the server by Viktor Szakats.
|
||||
|
||||
curl-for-QNX downloads are hosted on <https://curl.se/qnx> and are uploaded to
|
||||
the server by Daniel Stenberg.
|
||||
|
||||
Daily release tarball-like snapshots are generated automatically and are
|
||||
provided for download at <https://curl.se/snapshots/>.
|
||||
|
||||
CA certificate bundles are extracted from the Firefox source code, hosted by
|
||||
Mozilla and converted to PEM file format and is offered for download. The
|
||||
conversion checks for updates daily. The bundle is provided for download at
|
||||
<https://curl.se/docs/caextract.html>.
|
||||
|
||||
There is an automated "download check bot" that runs twice daily to scan for
|
||||
available curl downloads to populate the curl download page appropriately with
|
||||
the correct updated information. The bot uses URLs and patterns for all
|
||||
download packages and is maintained in a database, maintained by Daniel
|
||||
Stenberg and Dan Fandrich.
|
||||
|
||||
The TLS certificate for the origin curl web server is automatically updated
|
||||
from Let's Encrypt.
|
||||
|
||||
## CDN
|
||||
|
||||
Fastly runs the Content Delivery Network (CDN) that fronts all the curl
|
||||
websites. The CDN caches content that it gets from the origin server.
|
||||
Recently, roughly 99.99% of web requests are satisfied by the CDN without
|
||||
having to reach the origin.
|
||||
|
||||
The CDN caches different content at different lengths depending on the
|
||||
content-type. The caching thus adds to the time for a change to have an effect
|
||||
on the site from the moment it gets pushed to the git repository.
|
||||
|
||||
Using this setup, we provide four IPv4 addresses and eight IPv6 addresses for
|
||||
anycast access to the site. Should be snappy from virtually everywhere across
|
||||
the globe.
|
||||
|
||||
The CDN servers support HTTP/1, HTTP/2 and HTTP/3. They set HSTS for a year.
|
||||
The `HTTP://` version of the site redirects to `HTTPS://`.
|
||||
|
||||
Fastly manages the TLS certificates from Let's Encrypt for the servers they
|
||||
run on the behalf of curl.
|
||||
|
||||
## Containers
|
||||
|
||||
The curl project offer container builds of curl. The source repository for
|
||||
them is located at <https://github.com/curl/curl-container>.
|
||||
|
||||
Container images are hosted at <https://quay.io/repository/curl/curl> and
|
||||
<https://hub.docker.com/r/curlimages/curl>
|
||||
|
||||
## DNS
|
||||
|
||||
The primary domain name, `curl.se` is managed by Kirei and is offered over
|
||||
fault-tolerant anycast servers. High availability and fast access for
|
||||
everyone.
|
||||
|
||||
The actual physical DNS files and origin bind instance is managed by Daniel
|
||||
Stenberg.
|
||||
|
||||
## Mailing lists
|
||||
|
||||
The curl related mailing lists are hosted by Haxx AB on `lists.haxx.se` and
|
||||
are maintained by Daniel Stenberg. This includes the mailman2 and Postfix
|
||||
instances used for this.
|
||||
|
||||
## Email
|
||||
|
||||
We use a few rare additional curl related email aliases in the curl domains.
|
||||
They go through the mail server `mail.haxx.se` maintained by Daniel Stenberg
|
||||
|
||||
## Bug-bounty
|
||||
|
||||
We run a [bug-bounty](https://curl.se/docs/bugbounty.html) on HackerOne. The
|
||||
setup runs entirely at https://hackerone.com/curl.
|
||||
|
||||
The money part for the bug bounty is sponsored by the [Internet Bug
|
||||
Bounty](https://hackerone.com/ibb).
|
||||
|
||||
## Open Collective
|
||||
|
||||
We use [Open Collective](https://opencollective.com/curl) as our "fiscal
|
||||
host". All money sent to and received by the curl project is managed by Open
|
||||
Collective.
|
||||
|
||||
## Merchandise
|
||||
|
||||
We have stickers, coffee mugs and coasters. They are managed by Daniel who
|
||||
sits on the inventory. The best way to get your hands on curl merchandise is
|
||||
to attend events where Daniel is physically.
|
||||
|
||||
## Chat
|
||||
|
||||
Some curl developers, maintainers, users and enthusiasts use IRC for real-time
|
||||
chat about curl and related topics. This done in the `#curl` channel on the
|
||||
`libra.chat` IRC network. **Daniel Stenberg** (`bagder`) is registered owner
|
||||
of the channel. We do not run any IRC servers or services ourselves.
|
||||
|
||||
`curelbot` is a service in the channel that shows details about GitHub issues
|
||||
and pull requests when publicly mentioned using #[number]. The bot is run by
|
||||
user `TheAssassin`.
|
||||
|
||||
There is a Matrix bridge to the IRC channel called `matrix.curl.se`. The
|
||||
bridge is setup and run by **Sergio Durigan Junior** and **Daniel Stenberg**.
|
||||
|
||||
[curl online chat documentation](https://curl.se/docs/irc.html)
|
||||
@@ -1,9 +0,0 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
How To Compile
|
||||
|
||||
see INSTALL.md
|
||||
@@ -1,607 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Building with CMake
|
||||
|
||||
This document describes how to configure, build and install curl and libcurl
|
||||
from source code using the CMake build tool. To build with CMake, you of
|
||||
course first have to install CMake. The minimum required version of CMake is
|
||||
specified in the file `CMakeLists.txt` found in the top of the curl source
|
||||
tree. Once the correct version of CMake is installed you can follow the
|
||||
instructions below for the platform you are building on.
|
||||
|
||||
CMake builds can be configured either from the command line, or from one of
|
||||
CMake's GUIs.
|
||||
|
||||
# Configuring
|
||||
|
||||
A CMake configuration of curl is similar to the autotools build of curl.
|
||||
It consists of the following steps after you have unpacked the source.
|
||||
|
||||
We recommend building with CMake on Windows. For instructions on migrating
|
||||
from the `projects/Windows` Visual Studio solution files, see
|
||||
[this section](#migrating-from-visual-studio-ide-project-files). For
|
||||
instructions on migrating from the winbuild builds, see
|
||||
[the following section](#migrating-from-winbuild-builds).
|
||||
|
||||
## Using `cmake`
|
||||
|
||||
You can configure for in source tree builds or for a build tree
|
||||
that is apart from the source tree.
|
||||
|
||||
- Build in the source tree.
|
||||
|
||||
$ cmake -B .
|
||||
|
||||
- Build in a separate directory (parallel to the curl source tree in this
|
||||
example). The build directory is created for you. This is recommended over
|
||||
building in the source tree to separate source and build artifacts.
|
||||
|
||||
$ cmake -B ../curl-build
|
||||
|
||||
For the full list of CMake build configuration variables see
|
||||
[the corresponding section](#cmake-build-options).
|
||||
|
||||
### Fallback for CMake before version 3.13
|
||||
|
||||
CMake before version 3.13 does not support the `-B` option. In that case,
|
||||
you must create the build directory yourself, `cd` to it and run `cmake`
|
||||
from there:
|
||||
|
||||
$ mkdir ../curl-build
|
||||
$ cd ../curl-build
|
||||
$ cmake ../curl
|
||||
|
||||
If you want to build in the source tree, it is enough to do this:
|
||||
|
||||
$ cmake .
|
||||
|
||||
### Build system generator selection
|
||||
|
||||
You can override CMake's default by using `-G <generator-name>`. For example
|
||||
on Windows with multiple build systems if you have MinGW-w64 then you could use
|
||||
`-G "MinGW Makefiles"`.
|
||||
[List of generator names](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html).
|
||||
|
||||
## Using `ccmake`
|
||||
|
||||
CMake comes with a curses based interface called `ccmake`. To run `ccmake`
|
||||
on a curl use the instructions for the command line cmake, but substitute
|
||||
`ccmake` for `cmake`.
|
||||
|
||||
This brings up a curses interface with instructions on the bottom of the
|
||||
screen. You can press the "c" key to configure the project, and the "g" key to
|
||||
generate the project. After the project is generated, you can run make.
|
||||
|
||||
## Using `cmake-gui`
|
||||
|
||||
CMake also comes with a Qt based GUI called `cmake-gui`. To configure with
|
||||
`cmake-gui`, you run `cmake-gui` and follow these steps:
|
||||
|
||||
1. Fill in the "Where is the source code" combo box with the path to
|
||||
the curl source tree.
|
||||
2. Fill in the "Where to build the binaries" combo box with the path to
|
||||
the directory for your build tree, ideally this should not be the same
|
||||
as the source tree, but a parallel directory called curl-build or
|
||||
something similar.
|
||||
3. Once the source and binary directories are specified, press the
|
||||
"Configure" button.
|
||||
4. Select the native build tool that you want to use.
|
||||
5. At this point you can change any of the options presented in the GUI.
|
||||
Once you have selected all the options you want, click the "Generate"
|
||||
button.
|
||||
|
||||
# Building
|
||||
|
||||
Build (you have to specify the build directory).
|
||||
|
||||
$ cmake --build ../curl-build
|
||||
|
||||
## Static builds
|
||||
|
||||
The CMake build setup is primarily done to work with shared/dynamic third
|
||||
party dependencies. When linking with shared libraries, the dependency "chain"
|
||||
is handled automatically by the library loader - on all modern systems.
|
||||
|
||||
If you instead link with a static library, you need to provide all the
|
||||
dependency libraries already at the link command line.
|
||||
|
||||
Figuring out all the dependency libraries for a given library is hard, as it
|
||||
might involve figuring out the dependencies of the dependencies and they vary
|
||||
between platforms and can change between versions.
|
||||
|
||||
When using static dependencies, the build scripts mostly assume that you, the
|
||||
user, provide all the necessary additional dependency libraries as additional
|
||||
arguments in the build.
|
||||
|
||||
Building statically is not for the faint of heart.
|
||||
|
||||
### Fallback for CMake before version 3.13
|
||||
|
||||
CMake before version 3.13 does not support the `--build` option. In that
|
||||
case, you have to `cd` to the build directory and use the building tool that
|
||||
corresponds to the build files that CMake generated for you. This example
|
||||
assumes that CMake generates `Makefile`:
|
||||
|
||||
$ cd ../curl-build
|
||||
$ make
|
||||
|
||||
# Testing
|
||||
|
||||
(The test suite does not yet work with the cmake build)
|
||||
|
||||
# Installing
|
||||
|
||||
Install to default location (you have to specify the build directory).
|
||||
|
||||
$ cmake --install ../curl-build
|
||||
|
||||
Do not use `--prefix` to change the installation prefix as the output produced
|
||||
by the `curl-config` script is determined at CMake configure time. If you want
|
||||
to set a custom install prefix for curl, set
|
||||
[`CMAKE_INSTALL_PREFIX`](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
|
||||
when configuring the CMake build.
|
||||
|
||||
### Fallback for CMake before version 3.15
|
||||
|
||||
CMake before version 3.15 does not support the `--install` option. In that
|
||||
case, you have to `cd` to the build directory and use the building tool that
|
||||
corresponds to the build files that CMake generated for you. This example
|
||||
assumes that CMake generates `Makefile`:
|
||||
|
||||
$ cd ../curl-build
|
||||
$ make install
|
||||
|
||||
# CMake usage
|
||||
|
||||
Just as curl can be built and installed using CMake, it can also be used from
|
||||
CMake.
|
||||
|
||||
## Using `find_package`
|
||||
|
||||
To locate libcurl from CMake, one can use the standard
|
||||
[`find_package`](https://cmake.org/cmake/help/latest/command/find_package.html)
|
||||
command in the typical fashion:
|
||||
|
||||
```cmake
|
||||
find_package(CURL 8.12.0 REQUIRED) # FATAL_ERROR if CURL is not found
|
||||
```
|
||||
|
||||
This invokes the CMake-provided
|
||||
[FindCURL](https://cmake.org/cmake/help/latest/module/FindCURL.html) find module,
|
||||
which first performs a search using the `find_package`
|
||||
[config mode](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure).
|
||||
This is supported by the `CURLConfig.cmake` CMake config script which is
|
||||
available if the given CURL was built and installed using CMake.
|
||||
|
||||
### Detecting CURL features/protocols
|
||||
|
||||
Since version 8.12.0, `CURLConfig.cmake` publishes the supported CURL features
|
||||
and protocols (see [release notes](https://curl.se/ch/8.12.0.html)). These can
|
||||
be specified using the `find_package` keywords `COMPONENTS` and
|
||||
`OPTIONAL_COMPONENTS`, with protocols in all caps, e.g. `HTTPS`, `LDAP`, while
|
||||
features should be in their original sentence case, e.g. `AsynchDNS`,
|
||||
`UnixSockets`. If any of the `COMPONENTS` are missing, then CURL is considered
|
||||
as *not* found.
|
||||
|
||||
Here is an example of using `COMPONENTS` and `OPTIONAL_COMPONENTS` in
|
||||
`find_package` with CURL:
|
||||
|
||||
```cmake
|
||||
# CURL_FOUND is FALSE if no HTTPS but brotli and zstd can be missing
|
||||
find_package(CURL 8.12.0 COMPONENTS HTTPS OPTIONAL_COMPONENTS brotli zstd)
|
||||
```
|
||||
|
||||
One can also check the defined `CURL_SUPPORTS_<feature-or-protocol>` variables
|
||||
if a particular feature/protocol is supported. For example:
|
||||
|
||||
```cmake
|
||||
# check HTTPS
|
||||
if(CURL_SUPPORTS_HTTPS)
|
||||
message(STATUS "CURL supports HTTPS")
|
||||
else()
|
||||
message(STATUS "CURL does NOT support HTTPS")
|
||||
endif()
|
||||
```
|
||||
|
||||
### Linking against libcurl
|
||||
|
||||
To link a CMake target against libcurl one can use
|
||||
[`target_link_libraries`](https://cmake.org/cmake/help/latest/command/target_link_libraries.html)
|
||||
as usual:
|
||||
|
||||
```cmake
|
||||
target_link_libraries(my_target PRIVATE CURL::libcurl)
|
||||
```
|
||||
|
||||
# CMake build options
|
||||
|
||||
- `BUILD_CURL_EXE`: Build curl executable. Default: `ON`
|
||||
- `BUILD_EXAMPLES`: Build libcurl examples. Default: `ON`
|
||||
- `BUILD_LIBCURL_DOCS`: Build libcurl man pages. Default: `ON`
|
||||
- `BUILD_MISC_DOCS`: Build misc man pages (e.g. `curl-config` and `mk-ca-bundle`). Default: `ON`
|
||||
- `BUILD_SHARED_LIBS`: Build shared libraries. Default: `ON`
|
||||
- `BUILD_STATIC_CURL`: Build curl executable with static libcurl. Default: `OFF`
|
||||
- `BUILD_STATIC_LIBS`: Build static libraries. Default: `OFF`
|
||||
- `BUILD_TESTING`: Build tests. Default: `ON`
|
||||
- `CURL_CLANG_TIDY`: Run the build through `clang-tidy`. Default: `OFF`
|
||||
- `CURL_CLANG_TIDYFLAGS`: Custom options to pass to `clang-tidy`. Default: (empty)
|
||||
- `CURL_COMPLETION_FISH`: Install fish completions. Default: `OFF`
|
||||
- `CURL_COMPLETION_FISH_DIR`: Custom fish completion install directory.
|
||||
- `CURL_COMPLETION_ZSH`: Install zsh completions. Default: `OFF`
|
||||
- `CURL_COMPLETION_ZSH_DIR`: Custom zsh completion install directory.
|
||||
- `CURL_DEFAULT_SSL_BACKEND`: Override default TLS backend in MultiSSL builds.
|
||||
Accepted values in order of default priority:
|
||||
`wolfssl`, `gnutls`, `mbedtls`, `openssl`, `schannel`, `rustls`
|
||||
- `CURL_ENABLE_EXPORT_TARGET`: Enable CMake export target. Default: `ON`
|
||||
- `CURL_HIDDEN_SYMBOLS`: Hide libcurl internal symbols (=hide all symbols that are not officially external). Default: `ON`
|
||||
- `CURL_LIBCURL_SOVERSION`: Enable libcurl SOVERSION. Default: `ON` for supported platforms
|
||||
- `CURL_LIBCURL_VERSIONED_SYMBOLS`: Enable libcurl versioned symbols. Default: `OFF`
|
||||
- `CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX`: Override default versioned symbol prefix. Default: `<TLS-BACKEND>_` or `MULTISSL_`
|
||||
- `CURL_LTO`: Enable compiler Link Time Optimizations. Default: `OFF`
|
||||
- `CURL_STATIC_CRT`: Build libcurl with static CRT with MSVC (`/MT`) (requires UCRT, static libcurl or no curl executable). Default: `OFF`
|
||||
- `CURL_TARGET_WINDOWS_VERSION`: Minimum target Windows version as hex string.
|
||||
- `CURL_WERROR`: Turn compiler warnings into errors. Default: `OFF`
|
||||
- `ENABLE_CURLDEBUG`: Enable TrackMemory debug feature. Default: =`ENABLE_DEBUG`
|
||||
- `ENABLE_CURL_MANUAL`: Build the man page for curl and enable its `-M`/`--manual` option. Default: `ON`
|
||||
- `ENABLE_DEBUG`: Enable curl debug features (for developing curl itself). Default: `OFF`
|
||||
- `IMPORT_LIB_SUFFIX`: Import library suffix. Default: `_imp` for MSVC-like toolchains, otherwise empty.
|
||||
- `LIBCURL_OUTPUT_NAME`: Basename of the curl library. Default: `libcurl`
|
||||
- `PICKY_COMPILER`: Enable picky compiler options. Default: `ON`
|
||||
- `SHARE_LIB_OBJECT`: Build shared and static libcurl in a single pass (requires CMake 3.12 or newer). Default: `ON` for Windows
|
||||
- `STATIC_LIB_SUFFIX`: Static library suffix. Default: (empty)
|
||||
|
||||
## CA bundle options
|
||||
|
||||
- `CURL_CA_BUNDLE`: Path to the CA bundle. Set `none` to disable or `auto` for auto-detection. Default: `auto`
|
||||
- `CURL_CA_EMBED`: Path to the CA bundle to embed in the curl tool. Default: (disabled)
|
||||
- `CURL_CA_FALLBACK`: Use built-in CA store of TLS backend. Default: `OFF`
|
||||
- `CURL_CA_PATH`: Location of default CA path. Set `none` to disable or `auto` for auto-detection. Default: `auto`
|
||||
- `CURL_CA_SEARCH_SAFE`: Enable safe CA bundle search (within the curl tool directory) on Windows. Default: `OFF`
|
||||
|
||||
## Enabling features
|
||||
|
||||
- `CURL_ENABLE_SSL`: Enable SSL support. Default: `ON`
|
||||
- `CURL_WINDOWS_SSPI`: Enable SSPI on Windows. Default: =`CURL_USE_SCHANNEL`
|
||||
- `ENABLE_IPV6`: Enable IPv6 support. Default: `ON` if target supports IPv6.
|
||||
- `ENABLE_THREADED_RESOLVER`: Enable threaded DNS lookup. Default: `ON` if c-ares is not enabled and target supports threading.
|
||||
- `ENABLE_UNICODE`: Use the Unicode version of the Windows API functions. Default: `OFF`
|
||||
- `ENABLE_UNIX_SOCKETS`: Enable Unix domain sockets support. Default: `ON`
|
||||
- `USE_ECH`: Enable ECH support. Default: `OFF`
|
||||
- `USE_HTTPSRR`: Enable HTTPS RR support. Default: `OFF`
|
||||
- `USE_OPENSSL_QUIC`: Use OpenSSL and nghttp3 libraries for HTTP/3 support. Default: `OFF`
|
||||
- `USE_SSLS_EXPORT`: Enable experimental SSL session import/export. Default: `OFF`
|
||||
|
||||
## Disabling features
|
||||
|
||||
- `CURL_DISABLE_ALTSVC`: Disable alt-svc support. Default: `OFF`
|
||||
- `CURL_DISABLE_AWS`: Disable **aws-sigv4**. Default: `OFF`
|
||||
- `CURL_DISABLE_BASIC_AUTH`: Disable Basic authentication. Default: `OFF`
|
||||
- `CURL_DISABLE_BEARER_AUTH`: Disable Bearer authentication. Default: `OFF`
|
||||
- `CURL_DISABLE_BINDLOCAL`: Disable local binding support. Default: `OFF`
|
||||
- `CURL_DISABLE_CA_SEARCH`: Disable unsafe CA bundle search in PATH on Windows. Default: `OFF`
|
||||
- `CURL_DISABLE_COOKIES`: Disable cookies support. Default: `OFF`
|
||||
- `CURL_DISABLE_DICT`: Disable DICT. Default: `OFF`
|
||||
- `CURL_DISABLE_DIGEST_AUTH`: Disable Digest authentication. Default: `OFF`
|
||||
- `CURL_DISABLE_DOH`: Disable DNS-over-HTTPS. Default: `OFF`
|
||||
- `CURL_DISABLE_FILE`: Disable FILE. Default: `OFF`
|
||||
- `CURL_DISABLE_FORM_API`: Disable **form-api**. Default: =`CURL_DISABLE_MIME`
|
||||
- `CURL_DISABLE_FTP`: Disable FTP. Default: `OFF`
|
||||
- `CURL_DISABLE_GETOPTIONS`: Disable `curl_easy_options` API for existing options to `curl_easy_setopt`. Default: `OFF`
|
||||
- `CURL_DISABLE_GOPHER`: Disable Gopher. Default: `OFF`
|
||||
- `CURL_DISABLE_HEADERS_API`: Disable **headers-api** support. Default: `OFF`
|
||||
- `CURL_DISABLE_HSTS`: Disable HSTS support. Default: `OFF`
|
||||
- `CURL_DISABLE_HTTP`: Disable HTTP. Default: `OFF`
|
||||
- `CURL_DISABLE_HTTP_AUTH`: Disable all HTTP authentication methods. Default: `OFF`
|
||||
- `CURL_DISABLE_IMAP`: Disable IMAP. Default: `OFF`
|
||||
- `CURL_DISABLE_INSTALL`: Disable installation targets. Default: `OFF`
|
||||
- `CURL_DISABLE_IPFS`: Disable IPFS. Default: `OFF`
|
||||
- `CURL_DISABLE_KERBEROS_AUTH`: Disable Kerberos authentication. Default: `OFF`
|
||||
- `CURL_DISABLE_LDAP`: Disable LDAP. Default: `OFF`
|
||||
- `CURL_DISABLE_LDAPS`: Disable LDAPS. Default: =`CURL_DISABLE_LDAP`
|
||||
- `CURL_DISABLE_LIBCURL_OPTION`: Disable `--libcurl` option from the curl tool. Default: `OFF`
|
||||
- `CURL_DISABLE_MIME`: Disable MIME support. Default: `OFF`
|
||||
- `CURL_DISABLE_MQTT`: Disable MQTT. Default: `OFF`
|
||||
- `CURL_DISABLE_NEGOTIATE_AUTH`: Disable negotiate authentication. Default: `OFF`
|
||||
- `CURL_DISABLE_NETRC`: Disable netrc parser. Default: `OFF`
|
||||
- `CURL_DISABLE_NTLM`: Disable NTLM support. Default: `OFF`
|
||||
- `CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG`: Disable automatic loading of OpenSSL configuration. Default: `OFF`
|
||||
- `CURL_DISABLE_PARSEDATE`: Disable date parsing. Default: `OFF`
|
||||
- `CURL_DISABLE_POP3`: Disable POP3. Default: `OFF`
|
||||
- `CURL_DISABLE_PROGRESS_METER`: Disable built-in progress meter. Default: `OFF`
|
||||
- `CURL_DISABLE_PROXY`: Disable proxy support. Default: `OFF`
|
||||
- `CURL_DISABLE_RTSP`: Disable RTSP. Default: `OFF`
|
||||
- `CURL_DISABLE_SHA512_256`: Disable SHA-512/256 hash algorithm. Default: `OFF`
|
||||
- `CURL_DISABLE_SHUFFLE_DNS`: Disable shuffle DNS feature. Default: `OFF`
|
||||
- `CURL_DISABLE_SMB`: Disable SMB. Default: `OFF`
|
||||
- `CURL_DISABLE_SMTP`: Disable SMTP. Default: `OFF`
|
||||
- `CURL_DISABLE_SOCKETPAIR`: Disable use of socketpair for curl_multi_poll. Default: `OFF`
|
||||
- `CURL_DISABLE_SRP`: Disable TLS-SRP support. Default: `OFF`
|
||||
- `CURL_DISABLE_TELNET`: Disable Telnet. Default: `OFF`
|
||||
- `CURL_DISABLE_TFTP`: Disable TFTP. Default: `OFF`
|
||||
- `CURL_DISABLE_VERBOSE_STRINGS`: Disable verbose strings. Default: `OFF`
|
||||
- `CURL_DISABLE_WEBSOCKETS`: Disable WebSocket. Default: `OFF`
|
||||
- `HTTP_ONLY`: Disable all protocols except HTTP (This overrides all `CURL_DISABLE_*` options). Default: `OFF`
|
||||
|
||||
## Environment
|
||||
|
||||
- `CI`: Assume running under CI if set.
|
||||
- `CURL_BUILDINFO`: Print `buildinfo.txt` if set.
|
||||
- `CURL_CI`: Assume running under CI if set.
|
||||
|
||||
## CMake options
|
||||
|
||||
- `CMAKE_BUILD_TYPE`: (see CMake)
|
||||
- `CMAKE_DEBUG_POSTFIX`: Default: `-d`
|
||||
- `CMAKE_IMPORT_LIBRARY_SUFFIX` (see CMake)
|
||||
- `CMAKE_INSTALL_BINDIR` (see CMake)
|
||||
- `CMAKE_INSTALL_INCLUDEDIR` (see CMake)
|
||||
- `CMAKE_INSTALL_LIBDIR` (see CMake)
|
||||
- `CMAKE_INSTALL_PREFIX` (see CMake)
|
||||
- `CMAKE_STATIC_LIBRARY_SUFFIX` (see CMake)
|
||||
- `CMAKE_UNITY_BUILD_BATCH_SIZE`: Set the number of sources in a "unity" unit. Default: `0` (all)
|
||||
- `CMAKE_UNITY_BUILD`: Enable "unity" (aka jumbo) builds. Default: `OFF`
|
||||
|
||||
Details via CMake
|
||||
[variables](https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html) and
|
||||
[install directories](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html).
|
||||
|
||||
## Dependencies
|
||||
|
||||
- `CURL_BROTLI`: Use brotli (`ON`, `OFF` or `AUTO`). Default: `AUTO`
|
||||
- `CURL_USE_GNUTLS`: Enable GnuTLS for SSL/TLS. Default: `OFF`
|
||||
- `CURL_USE_GSASL`: Use libgsasl. Default: `OFF`
|
||||
- `CURL_USE_GSSAPI`: Use GSSAPI implementation. Default: `OFF`
|
||||
- `CURL_USE_LIBPSL`: Use libpsl. Default: `ON`
|
||||
- `CURL_USE_LIBSSH2`: Use libssh2. Default: `ON`
|
||||
- `CURL_USE_LIBSSH`: Use libssh. Default: `OFF`
|
||||
- `CURL_USE_LIBUV`: Use libuv for event-based tests. Default: `OFF`
|
||||
- `CURL_USE_MBEDTLS`: Enable mbedTLS for SSL/TLS. Default: `OFF`
|
||||
- `CURL_USE_OPENSSL`: Enable OpenSSL for SSL/TLS. Default: `ON` if no other TLS backend was enabled.
|
||||
- `CURL_USE_PKGCONFIG`: Enable `pkg-config` to detect dependencies. Default: `ON` for Unix (except Android, Apple devices), vcpkg, MinGW if not cross-compiling.
|
||||
- `CURL_USE_RUSTLS`: Enable Rustls for SSL/TLS. Default: `OFF`
|
||||
- `CURL_USE_SCHANNEL`: Enable Windows native SSL/TLS (Schannel). Default: `OFF`
|
||||
- `CURL_USE_WOLFSSH`: Use wolfSSH. Default: `OFF`
|
||||
- `CURL_USE_WOLFSSL`: Enable wolfSSL for SSL/TLS. Default: `OFF`
|
||||
- `CURL_ZLIB`: Use zlib (`ON`, `OFF` or `AUTO`). Default: `AUTO`
|
||||
- `CURL_ZSTD`: Use zstd (`ON`, `OFF` or `AUTO`). Default: `AUTO`
|
||||
- `ENABLE_ARES`: Enable c-ares support. Default: `OFF`
|
||||
- `USE_APPLE_IDN`: Use Apple built-in IDN support. Default: `OFF`
|
||||
- `USE_LIBIDN2`: Use libidn2 for IDN support. Default: `ON`
|
||||
- `USE_LIBRTMP`: Enable librtmp from rtmpdump. Default: `OFF`
|
||||
- `USE_MSH3`: Use msh3/msquic library for HTTP/3 support. Default: `OFF`
|
||||
- `USE_NGHTTP2`: Use nghttp2 library. Default: `ON`
|
||||
- `USE_NGTCP2`: Use ngtcp2 and nghttp3 libraries for HTTP/3 support. Default: `OFF`
|
||||
- `USE_QUICHE`: Use quiche library for HTTP/3 support. Default: `OFF`
|
||||
- `USE_WIN32_IDN`: Use WinIDN for IDN support. Default: `OFF`
|
||||
- `USE_WIN32_LDAP`: Use Windows LDAP implementation. Default: `ON`
|
||||
|
||||
## Dependency options (via CMake)
|
||||
|
||||
- `OPENSSL_ROOT_DIR`: Set this variable to the root installation of OpenSSL (and forks).
|
||||
- `OPENSSL_INCLUDE_DIR`: The OpenSSL include directory.
|
||||
- `OPENSSL_SSL_LIBRARY`: Path to `ssl` library. With MSVC, CMake uses variables `SSL_EAY_DEBUG`/`SSL_EAY_RELEASE` instead.
|
||||
- `OPENSSL_CRYPTO_LIBRARY`: Path to `crypto` library. With MSVC, CMake uses variables `LIB_EAY_DEBUG`/`LIB_EAY_RELEASE` instead.
|
||||
- `OPENSSL_USE_STATIC_LIBS`: Look for static OpenSSL libraries.
|
||||
- `ZLIB_INCLUDE_DIR`: The zlib include directory.
|
||||
- `ZLIB_LIBRARY`: Path to `zlib` library.
|
||||
- `ZLIB_USE_STATIC_LIBS`: Look for static ZLIB library (requires CMake v3.24).
|
||||
|
||||
## Dependency options (tools)
|
||||
|
||||
- `CLANG_TIDY`: `clang-tidy` tool used with `CURL_CLANG_TIDY=ON`. Default: `clang-tidy`
|
||||
- `PERL_EXECUTABLE`: Perl binary used throughout the build and tests.
|
||||
|
||||
## Dependency options (libraries)
|
||||
|
||||
- `AMISSL_INCLUDE_DIR`: The AmiSSL include directory.
|
||||
- `AMISSL_STUBS_LIBRARY`: Path to `amisslstubs` library.
|
||||
- `AMISSL_AUTO_LIBRARY`: Path to `amisslauto` library.
|
||||
- `BROTLI_INCLUDE_DIR`: The brotli include directory.
|
||||
- `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library.
|
||||
- `BROTLIDEC_LIBRARY`: Path to `brotlidec` library.
|
||||
- `CARES_INCLUDE_DIR`: The c-ares include directory.
|
||||
- `CARES_LIBRARY`: Path to `cares` library.
|
||||
- `DL_LIBRARY`: Path to `dl` library. (for Rustls)
|
||||
- `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment)
|
||||
- `LDAP_LIBRARY`: Name or full path to `ldap` library. Default: `ldap`
|
||||
- `LDAP_LBER_LIBRARY`: Name or full path to `lber` library. Default: `lber`
|
||||
- `LDAP_INCLUDE_DIR`: Path to LDAP include directory.
|
||||
- `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory.
|
||||
- `LIBGSASL_LIBRARY`: Path to `libgsasl` library.
|
||||
- `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory.
|
||||
- `LIBIDN2_LIBRARY`: Path to `libidn2` library.
|
||||
- `LIBPSL_INCLUDE_DIR`: The libpsl include directory.
|
||||
- `LIBPSL_LIBRARY`: Path to `libpsl` library.
|
||||
- `LIBRTMP_INCLUDE_DIR`: The librtmp include directory.
|
||||
- `LIBRTMP_LIBRARY`: Path to `librtmp` library.
|
||||
- `LIBSSH_INCLUDE_DIR`: The libssh include directory.
|
||||
- `LIBSSH_LIBRARY`: Path to `libssh` library.
|
||||
- `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory.
|
||||
- `LIBSSH2_LIBRARY`: Path to `libssh2` library.
|
||||
- `LIBUV_INCLUDE_DIR`: The libuv include directory.
|
||||
- `LIBUV_LIBRARY`: Path to `libuv` library.
|
||||
- `MATH_LIBRARY`: Path to `m` library. (for Rustls, wolfSSL)
|
||||
- `MBEDTLS_INCLUDE_DIR`: The mbedTLS include directory.
|
||||
- `MBEDTLS_LIBRARY`: Path to `mbedtls` library.
|
||||
- `MBEDX509_LIBRARY`: Path to `mbedx509` library.
|
||||
- `MBEDCRYPTO_LIBRARY`: Path to `mbedcrypto` library.
|
||||
- `MSH3_INCLUDE_DIR`: The msh3 include directory.
|
||||
- `MSH3_LIBRARY`: Path to `msh3` library.
|
||||
- `NGHTTP2_INCLUDE_DIR`: The nghttp2 include directory.
|
||||
- `NGHTTP2_LIBRARY`: Path to `nghttp2` library.
|
||||
- `NGHTTP3_INCLUDE_DIR`: The nghttp3 include directory.
|
||||
- `NGHTTP3_LIBRARY`: Path to `nghttp3` library.
|
||||
- `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory.
|
||||
- `NGTCP2_LIBRARY`: Path to `ngtcp2` library.
|
||||
- `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Path to `ngtcp2_crypto_boringssl` library.
|
||||
- `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Path to `ngtcp2_crypto_gnutls` library.
|
||||
- `NGTCP2_CRYPTO_OSSL_LIBRARY`: Path to `ngtcp2_crypto_ossl` library.
|
||||
- `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Path to `ngtcp2_crypto_quictls` library.
|
||||
- `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Path to `ngtcp2_crypto_wolfssl` library.
|
||||
- `NETTLE_INCLUDE_DIR`: The nettle include directory.
|
||||
- `NETTLE_LIBRARY`: Path to `nettle` library.
|
||||
- `PTHREAD_LIBRARY`: Path to `pthread` library. (for Rustls)
|
||||
- `QUICHE_INCLUDE_DIR`: The quiche include directory.
|
||||
- `QUICHE_LIBRARY`: Path to `quiche` library.
|
||||
- `RUSTLS_INCLUDE_DIR`: The Rustls include directory.
|
||||
- `RUSTLS_LIBRARY`: Path to `rustls` library.
|
||||
- `WATT_ROOT`: Set this variable to the root installation of Watt-32.
|
||||
- `WOLFSSH_INCLUDE_DIR`: The wolfSSH include directory.
|
||||
- `WOLFSSH_LIBRARY`: Path to `wolfssh` library.
|
||||
- `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory.
|
||||
- `WOLFSSL_LIBRARY`: Path to `wolfssl` library.
|
||||
- `ZSTD_INCLUDE_DIR`: The zstd include directory.
|
||||
- `ZSTD_LIBRARY`: Path to `zstd` library.
|
||||
|
||||
## Test tools
|
||||
|
||||
- `APXS`: Default: `apxs`
|
||||
- `CADDY`: Default: `caddy`
|
||||
- `HTTPD_NGHTTPX`: Default: `nghttpx`
|
||||
- `HTTPD`: Default: `apache2`
|
||||
- `TEST_NGHTTPX`: Default: `nghttpx`
|
||||
- `VSFTPD`: Default: `vsftps`
|
||||
|
||||
## Feature detection variables
|
||||
|
||||
By default this CMake build script detects the version of some dependencies
|
||||
using `check_symbol_exists`. Those checks do not work in the case that both
|
||||
CURL and its dependency are included as sub-projects in a larger build using
|
||||
`FetchContent`. To support that case, additional variables may be defined by
|
||||
the parent project, ideally in the "extra" find package redirect file:
|
||||
<https://cmake.org/cmake/help/latest/module/FetchContent.html#integrating-with-find-package>
|
||||
|
||||
Available variables:
|
||||
|
||||
- `HAVE_GNUTLS_SRP`: `gnutls_srp_verifier` present in GnuTLS.
|
||||
- `HAVE_GSS_C_NT_HOSTBASED_SERVICE`: `GSS_C_NT_HOSTBASED_SERVICE` present in GSS/Heimdal/Kerberos.
|
||||
- `HAVE_LDAP_INIT_FD`: `ldap_init_fd` present in LDAP library.
|
||||
- `HAVE_LDAP_URL_PARSE`: `ldap_url_parse` present in LDAP library.
|
||||
- `HAVE_OPENSSL_SRP`: `SSL_CTX_set_srp_username` present in OpenSSL (or fork).
|
||||
- `HAVE_QUICHE_CONN_SET_QLOG_FD`: `quiche_conn_set_qlog_fd` present in quiche.
|
||||
- `HAVE_RUSTLS_SUPPORTED_HPKE`: `rustls_supported_hpke` present in Rustls (unused if Rustls is detected via `pkg-config`).
|
||||
- `HAVE_SSL_SET0_WBIO`: `SSL_set0_wbio` present in OpenSSL (or fork).
|
||||
- `HAVE_SSL_SET1_ECH_CONFIG_LIST`: `SSL_set1_ech_config_list` present in OpenSSL (or fork).
|
||||
- `HAVE_SSL_SET_QUIC_TLS_CBS`: `SSL_set_quic_tls_cbs` in OpenSSL.
|
||||
- `HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT`: `SSL_set_quic_use_legacy_codepoint` in OpenSSL fork.
|
||||
- `HAVE_WOLFSSL_BIO_NEW`: `wolfSSL_BIO_new` present in wolfSSL.
|
||||
- `HAVE_WOLFSSL_BIO_SET_SHUTDOWN`: `wolfSSL_BIO_set_shutdown` present in wolfSSL.
|
||||
- `HAVE_WOLFSSL_CTX_GENERATEECHCONFIG`: `wolfSSL_CTX_GenerateEchConfig` present in wolfSSL.
|
||||
- `HAVE_WOLFSSL_DES_ECB_ENCRYPT`: `wolfSSL_DES_ecb_encrypt` present in wolfSSL.
|
||||
- `HAVE_WOLFSSL_GET_PEER_CERTIFICATE`: `wolfSSL_get_peer_certificate` present in wolfSSL.
|
||||
- `HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT`:
|
||||
`wolfSSL_set_quic_use_legacy_codepoint` present in wolfSSL.
|
||||
- `HAVE_WOLFSSL_USEALPN`: `wolfSSL_UseALPN` present in wolfSSL.
|
||||
|
||||
For each of the above variables, if the variable is *defined* (either to `ON`
|
||||
or `OFF`), the symbol detection is skipped. If the variable is *not defined*,
|
||||
the feature detection is performed.
|
||||
|
||||
Note: These variables are internal and subject to change.
|
||||
|
||||
# Migrating from Visual Studio IDE Project Files
|
||||
|
||||
We recommend using CMake to build curl with MSVC.
|
||||
|
||||
The project build files reside in project/Windows/VC\* for VS2010, VS2012 and
|
||||
VS2013.
|
||||
|
||||
These CMake Visual Studio generators require CMake v3.24 or older. You can
|
||||
download them from <https://cmake.org/files/v3.24/>.
|
||||
|
||||
You can also use `-G "NMake Makefiles"`, which is supported by all CMake
|
||||
versions.
|
||||
|
||||
Configuration element | Equivalent CMake options
|
||||
:-------------------------------- | :--------------------------------
|
||||
`VC10` | `-G "Visual Studio 10 2010"`
|
||||
`VC11` | `-G "Visual Studio 11 2012"`
|
||||
`VC12` | `-G "Visual Studio 12 2013"`
|
||||
`x64` | `-A x64`
|
||||
`Win32` | `-A Win32`
|
||||
`DLL` | `BUILD_SHARED_LIBS=ON`, `BUILD_STATIC_LIBS=OFF`, (default)
|
||||
`LIB` | `BUILD_SHARED_LIBS=OFF`, `BUILD_STATIC_LIBS=ON`
|
||||
`Debug` | `CMAKE_BUILD_TYPE=Debug` (`-G "NMake Makefiles"` only)
|
||||
`Release` | `CMAKE_BUILD_TYPE=Release` (`-G "NMake Makefiles"` only)
|
||||
`DLL Windows SSPI` | `CURL_USE_SCHANNEL=ON` (with SSPI enabled by default)
|
||||
`DLL OpenSSL` | `CURL_USE_OPENSSL=ON`, optional: `OPENSSL_ROOT_DIR`, `OPENSSL_USE_STATIC_LIBS=ON`
|
||||
`DLL libssh2` | `CURL_USE_LIBSSH2=ON`, optional: `LIBSSH2_INCLUDE_DIR`, `LIBSSH2_LIBRARY`
|
||||
`DLL WinIDN` | `USE_WIN32_IDN=ON`
|
||||
|
||||
For example these commands:
|
||||
|
||||
> cd projects
|
||||
> ./generate.bat VC12
|
||||
> msbuild "-property:Configuration=DLL Debug - DLL Windows SSPI - DLL WinIDN" Windows/VC12/curl-all.sln
|
||||
|
||||
translate to:
|
||||
|
||||
> cmake . -G "Visual Studio 12 2013" -A x64 -DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON -DCURL_USE_LIBPSL=OFF
|
||||
> cmake --build . --config Debug --parallel
|
||||
|
||||
We do *not* specify `-DCMAKE_BUILD_TYPE=Debug` here as we might do for the
|
||||
`"NMake Makefiles"` generator because the Visual Studio generators are
|
||||
[multi-config generators](https://cmake.org/cmake/help/latest/prop_gbl/GENERATOR_IS_MULTI_CONFIG.html)
|
||||
and therefore ignore the value of `CMAKE_BUILD_TYPE`.
|
||||
|
||||
# Migrating from winbuild builds
|
||||
|
||||
We recommend CMake to build curl with MSVC. The winbuild build system is
|
||||
deprecated and is going to be removed in September 2025 in favor of the CMake
|
||||
build system.
|
||||
|
||||
In CMake you can customize the path of dependencies by passing the absolute
|
||||
header path and the full path of the library via `*_INCLUDE_DIR` and
|
||||
`*_LIBRARY` options (see the complete list in the option listing above).
|
||||
The full path to the library can point to a static library or an import
|
||||
library, which defines if the dependency is linked as a dll or statically.
|
||||
For OpenSSL this works
|
||||
[differently](https://cmake.org/cmake/help/latest/module/FindOpenSSL.html):
|
||||
You can pass the root directory of the OpenSSL installation via
|
||||
`OPENSSL_ROOT_DIR`, then pass `OPENSSL_USE_STATIC_LIBS=ON` to select static
|
||||
libs.
|
||||
|
||||
winbuild options | Equivalent CMake options
|
||||
:-------------------------------- | :--------------------------------
|
||||
`DEBUG` | `CMAKE_BUILD_TYPE=Debug`
|
||||
`GEN_PDB` | `CMAKE_EXE_LINKER_FLAGS=/Fd<path>`, `CMAKE_SHARED_LINKER_FLAGS=/Fd<path>`
|
||||
`LIB_NAME_DLL`, `LIB_NAME_STATIC` | `IMPORT_LIB_SUFFIX`, `LIBCURL_OUTPUT_NAME`, `STATIC_LIB_SUFFIX`
|
||||
`VC`: `<N>` | see the CMake [Visual Studio generators](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators)
|
||||
`MACHINE`: `x64`, `x86` | `-A x64`, `-A Win32`
|
||||
`MODE`: `dll`, `static` | `BUILD_SHARED_LIBS=ON/OFF`, `BUILD_STATIC_LIBS=ON/OFF`, `BUILD_STATIC_CURL=ON/OFF` (default: dll)
|
||||
`RTLIBCFG`: `static` | `CURL_STATIC_CRT=ON`
|
||||
`ENABLE_IDN` | `USE_WIN32_IDN=ON`
|
||||
`ENABLE_IPV6` | `ENABLE_IPV6=ON`
|
||||
`ENABLE_MSH3` | `USE_MSH3=ON`
|
||||
`ENABLE_NGHTTP2` | `USE_NGHTTP2=ON`
|
||||
`ENABLE_OPENSSL_AUTO_LOAD_CONFIG` | `CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=OFF` (default)
|
||||
`ENABLE_SCHANNEL` | `CURL_USE_SCHANNEL=ON`
|
||||
`ENABLE_SSPI` | `CURL_WINDOWS_SSPI=ON` (default with Schannel)
|
||||
`ENABLE_UNICODE` | `ENABLE_UNICODE=ON`
|
||||
`WITH_PREFIX` | `CMAKE_INSTALL_PREFIX=<path>`
|
||||
`WITH_DEVEL` | see individual `*_INCLUDE_DIR` and `*_LIBRARY` options and `OPENSSL_ROOT_DIR`
|
||||
`WITH_CARES`, `CARES_PATH` | `ENABLE_ARES=ON`, optional: `CARES_INCLUDE_DIR`, `CARES_LIBRARY`
|
||||
`WITH_MBEDTLS`, `MBEDTLS_PATH` | `CURL_USE_MBEDTLS=ON`, optional: `MBEDTLS_INCLUDE_DIR`, `MBEDTLS_LIBRARY`, `MBEDX509_LIBRARY`, `MBEDCRYPTO_LIBRARY`
|
||||
`WITH_MSH3`, `MSH_PATH` | `USE_MSH3=ON`, optional: `MSH3_INCLUDE_DIR`, `MSH3_LIBRARY`
|
||||
`WITH_NGHTTP2`, `NGHTTP2_PATH` | `USE_NGHTTP2=ON`, optional: `NGHTTP2_INCLUDE_DIR`, `NGHTTP2_LIBRARY`
|
||||
`WITH_SSH`, `SSH_PATH` | `CURL_USE_LIBSSH=ON`, optional: `LIBSSH_INCLUDE_DIR`, `LIBSSH_LIBRARY`
|
||||
`WITH_SSH2`, `SSH2_PATH` | `CURL_USE_LIBSSH2=ON`, optional: `LIBSSH2_INCLUDE_DIR`, `LIBSSH2_LIBRARY`
|
||||
`WITH_SSL`, `SSL_PATH` | `CURL_USE_OPENSSL=ON`, optional: `OPENSSL_ROOT_DIR`, `OPENSSL_USE_STATIC_LIBS=ON`
|
||||
`WITH_WOLFSSL`, `WOLFSSL_PATH` | `CURL_USE_WOLFSSL=ON`, optional: `WOLFSSL_INCLUDE_DIR`, `WOLFSSL_LIBRARY`
|
||||
`WITH_ZLIB`, `ZLIB_PATH` | `CURL_ZLIB=ON`, optional: `ZLIB_INCLUDE_DIR`, `ZLIB_LIBRARY`
|
||||
|
||||
For example this command-line:
|
||||
|
||||
> nmake -f Makefile.vc VC=17 MACHINE=x64 DEBUG=ON mode=dll SSL_PATH=C:\OpenSSL WITH_SSL=dll ENABLE_UNICODE=ON
|
||||
|
||||
translates to:
|
||||
|
||||
> cmake . -G "Visual Studio 17 2022" -A x64 -DBUILD_SHARED_LIBS=ON -DOPENSSL_ROOT_DIR=C:\OpenSSL -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=ON -DCURL_USE_LIBPSL=OFF
|
||||
> cmake --build . --config Debug
|
||||
|
||||
We use `--config` with `cmake --build` because the Visual Studio CMake
|
||||
generators are multi-config and therefore ignore `CMAKE_BUILD_TYPE`.
|
||||
@@ -1,643 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# How to install curl and libcurl
|
||||
|
||||
## Installing Binary Packages
|
||||
|
||||
Lots of people download binary distributions of curl and libcurl. This
|
||||
document does not describe how to install curl or libcurl using such a binary
|
||||
package. This document describes how to compile, build and install curl and
|
||||
libcurl from [source code](https://curl.se/download.html).
|
||||
|
||||
## Building using vcpkg
|
||||
|
||||
You can download and install curl and libcurl using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
|
||||
|
||||
git clone https://github.com/Microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
./bootstrap-vcpkg.sh
|
||||
./vcpkg integrate install
|
||||
vcpkg install curl[tool]
|
||||
|
||||
The curl port in vcpkg is kept up to date by Microsoft team members and
|
||||
community contributors. If the version is out of date, please [create an issue
|
||||
or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
||||
|
||||
## Building from git
|
||||
|
||||
If you get your code off a git repository instead of a release tarball, see
|
||||
the [GIT-INFO.md](https://github.com/curl/curl/blob/master/GIT-INFO.md) file in the root directory for specific instructions on how
|
||||
to proceed.
|
||||
|
||||
# Unix
|
||||
|
||||
A normal Unix installation is made in three or four steps (after you have
|
||||
unpacked the source archive):
|
||||
|
||||
./configure --with-openssl [--with-gnutls --with-wolfssl]
|
||||
make
|
||||
make test (optional)
|
||||
make install
|
||||
|
||||
(Adjust the configure line accordingly to use the TLS library you want.)
|
||||
|
||||
You probably need to be root when doing the last command.
|
||||
|
||||
Get a full listing of all available configure options by invoking it like:
|
||||
|
||||
./configure --help
|
||||
|
||||
If you want to install curl in a different file hierarchy than `/usr/local`,
|
||||
specify that when running configure:
|
||||
|
||||
./configure --prefix=/path/to/curl/tree
|
||||
|
||||
If you have write permission in that directory, you can do 'make install'
|
||||
without being root. An example of this would be to make a local install in
|
||||
your own home directory:
|
||||
|
||||
./configure --prefix=$HOME
|
||||
make
|
||||
make install
|
||||
|
||||
The configure script always tries to find a working SSL library unless
|
||||
explicitly told not to. If you have OpenSSL installed in the default search
|
||||
path for your compiler/linker, you do not need to do anything special. If you
|
||||
have OpenSSL installed in `/usr/local/ssl`, you can run configure like:
|
||||
|
||||
./configure --with-openssl
|
||||
|
||||
If you have OpenSSL installed somewhere else (for example, `/opt/OpenSSL`) and
|
||||
you have pkg-config installed, set the pkg-config path first, like this:
|
||||
|
||||
env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-openssl
|
||||
|
||||
Without pkg-config installed, use this:
|
||||
|
||||
./configure --with-openssl=/opt/OpenSSL
|
||||
|
||||
If you insist on forcing a build without SSL support, you can run configure
|
||||
like this:
|
||||
|
||||
./configure --without-ssl
|
||||
|
||||
If you have OpenSSL installed, but with the libraries in one place and the
|
||||
header files somewhere else, you have to set the `LDFLAGS` and `CPPFLAGS`
|
||||
environment variables prior to running configure. Something like this should
|
||||
work:
|
||||
|
||||
CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" ./configure
|
||||
|
||||
If you have shared SSL libs installed in a directory where your runtime
|
||||
linker does not find them (which usually causes configure failures), you can
|
||||
provide this option to gcc to set a hard-coded path to the runtime linker:
|
||||
|
||||
LDFLAGS=-Wl,-R/usr/local/ssl/lib ./configure --with-openssl
|
||||
|
||||
## Static builds
|
||||
|
||||
To force a static library compile, disable the shared library creation by
|
||||
running configure like:
|
||||
|
||||
./configure --disable-shared
|
||||
|
||||
The configure script is primarily done to work with shared/dynamic third party
|
||||
dependencies. When linking with shared libraries, the dependency "chain" is
|
||||
handled automatically by the library loader - on all modern systems.
|
||||
|
||||
If you instead link with a static library, you need to provide all the
|
||||
dependency libraries already at the link command line.
|
||||
|
||||
Figuring out all the dependency libraries for a given library is hard, as it
|
||||
might involve figuring out the dependencies of the dependencies and they vary
|
||||
between platforms and change between versions.
|
||||
|
||||
When using static dependencies, the build scripts mostly assume that you, the
|
||||
user, provide all the necessary additional dependency libraries as additional
|
||||
arguments in the build. With configure, by setting `LIBS` or `LDFLAGS` on the
|
||||
command line.
|
||||
|
||||
Building statically is not for the faint of heart.
|
||||
|
||||
## Debug
|
||||
|
||||
If you are a curl developer and use gcc, you might want to enable more debug
|
||||
options with the `--enable-debug` option.
|
||||
|
||||
curl can be built to use a whole range of libraries to provide various useful
|
||||
services, and configure tries to auto-detect a decent default. If you want to
|
||||
alter it, you can select how to deal with each individual library.
|
||||
|
||||
## Select TLS backend
|
||||
|
||||
These options are provided to select the TLS backend to use.
|
||||
|
||||
- AmiSSL: `--with-amissl`
|
||||
- GnuTLS: `--with-gnutls`.
|
||||
- mbedTLS: `--with-mbedtls`
|
||||
- OpenSSL: `--with-openssl` (also for BoringSSL, AWS-LC, LibreSSL, and quictls)
|
||||
- rustls: `--with-rustls`
|
||||
- Schannel: `--with-schannel`
|
||||
- wolfSSL: `--with-wolfssl`
|
||||
|
||||
You can build curl with *multiple* TLS backends at your choice, but some TLS
|
||||
backends cannot be combined: if you build with an OpenSSL fork (or wolfSSL),
|
||||
you cannot add another OpenSSL fork (or wolfSSL) simply because they have
|
||||
conflicting identical symbol names.
|
||||
|
||||
When you build with multiple TLS backends, you can select the active one at
|
||||
runtime when curl starts up.
|
||||
|
||||
## MultiSSL and HTTP/3
|
||||
|
||||
HTTP/3 needs QUIC and QUIC needs TLS. Building libcurl with HTTP/3 and QUIC
|
||||
support is not compatible with the MultiSSL feature: they are mutually
|
||||
exclusive. If you need MultiSSL in your build, you cannot have HTTP/3 support
|
||||
and vice versa.
|
||||
|
||||
libcurl can only use a single TLS library with QUIC and that *same* TLS
|
||||
library needs to be used for the other TLS using protocols.
|
||||
|
||||
## Configure finding libs in wrong directory
|
||||
|
||||
When the configure script checks for third-party libraries, it adds those
|
||||
directories to the `LDFLAGS` variable and then tries linking to see if it
|
||||
works. When successful, the found directory is kept in the `LDFLAGS` variable
|
||||
when the script continues to execute and do more tests and possibly check for
|
||||
more libraries.
|
||||
|
||||
This can make subsequent checks for libraries wrongly detect another
|
||||
installation in a directory that was previously added to `LDFLAGS` by another
|
||||
library check.
|
||||
|
||||
# Windows
|
||||
|
||||
Building for Windows XP is required as a minimum.
|
||||
|
||||
You can build curl with:
|
||||
|
||||
- Microsoft Visual Studio 2008 v9.0 or later (`_MSC_VER >= 1500`)
|
||||
- MinGW-w64
|
||||
|
||||
## Building Windows DLLs and C runtime (CRT) linkage issues
|
||||
|
||||
As a general rule, building a DLL with static CRT linkage is highly
|
||||
discouraged, and intermixing CRTs in the same app is something to avoid at
|
||||
any cost.
|
||||
|
||||
Reading and comprehending Microsoft Knowledge Base articles KB94248 and
|
||||
KB140584 is a must for any Windows developer. Especially important is full
|
||||
understanding if you are not going to follow the advice given above.
|
||||
|
||||
- [How To Use the C Runtime](https://support.microsoft.com/help/94248/how-to-use-the-c-run-time)
|
||||
- [Runtime Library Compiler Options](https://docs.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-library)
|
||||
- [Potential Errors Passing CRT Objects Across DLL Boundaries](https://docs.microsoft.com/cpp/c-runtime-library/potential-errors-passing-crt-objects-across-dll-boundaries)
|
||||
|
||||
If your app is misbehaving in some strange way, or it is suffering from memory
|
||||
corruption, before asking for further help, please try first to rebuild every
|
||||
single library your app uses as well as your app using the debug
|
||||
multi-threaded dynamic C runtime.
|
||||
|
||||
If you get linkage errors read section 5.7 of the FAQ document.
|
||||
|
||||
## Cygwin
|
||||
|
||||
Almost identical to the Unix installation. Essentially run the configure script in the
|
||||
curl source tree root with `sh configure`, then run `make`.
|
||||
|
||||
To expand on building with `cygwin` first ensure it is in your path, and there are no
|
||||
conflicting tools (*i.e. Chocolatey with sed package*). If so move `cygwin` ahead of any items
|
||||
in your path that would conflict with `cygwin` commands, making sure you have the `sh`
|
||||
executable in `/bin/` or you see the configure fail toward the end.
|
||||
|
||||
Download the setup installer from
|
||||
[`cygwin`](https://cygwin.com/) to begin. Additional `cygwin`
|
||||
packages are needed for the install. For more on installing packages visit
|
||||
[`cygwin setup`](https://www.cygwin.com/faq/faq.html#faq.setup.cli).
|
||||
|
||||
Either run setup-x86_64.exe, then search and select packages individually, or try:
|
||||
|
||||
setup-x86_64.exe -P binutils -P gcc-core -P libpsl-devel -P libtool -P perl -P make
|
||||
|
||||
If the latter, matching packages should appear in the install rows (*is fickle though*) after selecting
|
||||
the download site i.e. `https://mirrors.kernel.org`. In either case, follow the GUI prompts
|
||||
until you reach the "Select Packages" window; then select packages, click next, and finish
|
||||
the `cygwin` package installation.
|
||||
|
||||
Download the latest version of the `cygwin` packages required (*and suggested*) for a successful install:
|
||||
|
||||
<details>
|
||||
<summary>Package List</summary>
|
||||
|
||||
```
|
||||
binutil - required
|
||||
gcc-core - required
|
||||
libpsl-devel - required
|
||||
libtool - required
|
||||
perl - required
|
||||
make - required
|
||||
- NOTE - if there is an error regarding make, open the cygwin terminal, and run:
|
||||
ln -s /usr/bin/make /usr/bin/gmake
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
Once all the packages have been installed, begin the process of installing curl from the source code:
|
||||
|
||||
<details>
|
||||
<summary>configure_options</summary>
|
||||
|
||||
```
|
||||
--with-gnutls
|
||||
--with-mbedtls
|
||||
--with-openssl (also works for OpenSSL forks)
|
||||
--with-rustls
|
||||
--with-wolfssl
|
||||
--without-ssl
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
1. `sh configure <configure_options>`
|
||||
2. `make`
|
||||
|
||||
If any error occurs during curl installation, try:
|
||||
- reinstalling the required `cygwin` packages from the list above
|
||||
- temporarily move `cygwin` to the top of your path
|
||||
- install all of the suggested `cygwin` packages
|
||||
|
||||
## MS-DOS
|
||||
|
||||
You can use either autotools or cmake:
|
||||
|
||||
./configure \
|
||||
CC=/path/to/djgpp/bin/i586-pc-msdosdjgpp-gcc \
|
||||
AR=/path/to/djgpp/bin/i586-pc-msdosdjgpp-ar \
|
||||
RANLIB=/path/to/djgpp/bin/i586-pc-msdosdjgpp-ranlib \
|
||||
WATT_ROOT=/path/to/djgpp/net/watt \
|
||||
--host=i586-pc-msdosdjgpp \
|
||||
--with-openssl=/path/to/djgpp \
|
||||
--with-zlib=/path/to/djgpp \
|
||||
--without-libpsl \
|
||||
--disable-shared
|
||||
|
||||
cmake . \
|
||||
-DCMAKE_SYSTEM_NAME=DOS \
|
||||
-DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
|
||||
-DCMAKE_C_COMPILER=/path/to/djgpp/bin/i586-pc-msdosdjgpp-gcc \
|
||||
-DWATT_ROOT=/path/to/djgpp/net/watt \
|
||||
-DOPENSSL_INCLUDE_DIR=/path/to/djgpp/include \
|
||||
-DOPENSSL_SSL_LIBRARY=/path/to/djgpp/lib/libssl.a \
|
||||
-DOPENSSL_CRYPTO_LIBRARY=/path/to/djgpp/lib/libcrypto.a \
|
||||
-DZLIB_INCLUDE_DIR=/path/to/djgpp/include \
|
||||
-DZLIB_LIBRARY=/path/to/djgpp/lib/libz.a \
|
||||
-DCURL_USE_LIBPSL=OFF
|
||||
|
||||
Notes:
|
||||
|
||||
- Requires DJGPP 2.04 or upper.
|
||||
|
||||
- Compile Watt-32 (and OpenSSL) with the same version of DJGPP. Otherwise
|
||||
things go wrong because things like FS-extensions and `errno` values have
|
||||
been changed between releases.
|
||||
|
||||
## AmigaOS
|
||||
|
||||
You can use either autotools or cmake:
|
||||
|
||||
./configure \
|
||||
CC=/opt/amiga/bin/m68k-amigaos-gcc \
|
||||
AR=/opt/amiga/bin/m68k-amigaos-ar \
|
||||
RANLIB=/opt/amiga/bin/m68k-amigaos-ranlib \
|
||||
--host=m68k-amigaos \
|
||||
--with-amissl \
|
||||
CFLAGS='-O0 -msoft-float -mcrt=clib2' \
|
||||
CPPFLAGS=-I/path/to/AmiSSL/Developer/include \
|
||||
LDFLAGS=-L/path/to/AmiSSL/Developer/lib/AmigaOS3 \
|
||||
LIBS='-lnet -lm -latomic' \
|
||||
--without-libpsl \
|
||||
--disable-shared
|
||||
|
||||
cmake . \
|
||||
-DAMIGA=1 \
|
||||
-DCMAKE_SYSTEM_NAME=Generic \
|
||||
-DCMAKE_C_COMPILER_TARGET=m68k-unknown-amigaos \
|
||||
-DCMAKE_C_COMPILER=/opt/amiga/bin/m68k-amigaos-gcc \
|
||||
-DCMAKE_C_FLAGS='-O0 -msoft-float -mcrt=clib2' \
|
||||
-DAMISSL_INCLUDE_DIR=/path/to/AmiSSL/Developer/include \
|
||||
-DAMISSL_STUBS_LIBRARY=/path/to/AmiSSL/Developer/lib/AmigaOS3/libamisslstubs.a \
|
||||
-DAMISSL_AUTO_LIBRARY=/path/to/AmiSSL/Developer/lib/AmigaOS3/libamisslauto.a \
|
||||
-DCURL_USE_LIBPSL=OFF
|
||||
|
||||
## Disabling Specific Protocols in Windows builds
|
||||
|
||||
The configure utility, unfortunately, is not available for the Windows
|
||||
environment, therefore, you cannot use the various disable-protocol options of
|
||||
the configure utility on this platform.
|
||||
|
||||
You can use specific defines to disable specific protocols and features. See
|
||||
[CURL-DISABLE](https://github.com/curl/curl/blob/master/docs/CURL-DISABLE.md)
|
||||
for the full list.
|
||||
|
||||
If you want to set any of these defines you have the following options:
|
||||
|
||||
- Modify `lib/config-win32.h`
|
||||
- Modify `lib/curl_setup.h`
|
||||
- Modify `winbuild/Makefile.vc`
|
||||
- Modify the "Preprocessor Definitions" in the libcurl project
|
||||
|
||||
Note: The pre-processor settings can be found using the Visual Studio IDE
|
||||
under "Project -> Properties -> Configuration Properties -> C/C++ ->
|
||||
Preprocessor".
|
||||
|
||||
## Using BSD-style lwIP instead of Winsock TCP/IP stack in Windows builds
|
||||
|
||||
In order to compile libcurl and curl using BSD-style lwIP TCP/IP stack it is
|
||||
necessary to make the definition of the preprocessor symbol `USE_LWIPSOCK`
|
||||
visible to libcurl and curl compilation processes. To set this definition you
|
||||
have the following alternatives:
|
||||
|
||||
- Modify `lib/config-win32.h`
|
||||
- Modify `winbuild/Makefile.vc`
|
||||
- Modify the "Preprocessor Definitions" in the libcurl project
|
||||
|
||||
Note: The pre-processor settings can be found using the Visual Studio IDE
|
||||
under "Project -> Properties -> Configuration Properties -> C/C++ ->
|
||||
Preprocessor".
|
||||
|
||||
Once that libcurl has been built with BSD-style lwIP TCP/IP stack support, in
|
||||
order to use it with your program it is mandatory that your program includes
|
||||
lwIP header file `<lwip/opt.h>` (or another lwIP header that includes this)
|
||||
before including any libcurl header. Your program does not need the
|
||||
`USE_LWIPSOCK` preprocessor definition which is for libcurl internals only.
|
||||
|
||||
Compilation has been verified with lwIP 1.4.0.
|
||||
|
||||
This BSD-style lwIP TCP/IP stack support must be considered experimental given
|
||||
that it has been verified that lwIP 1.4.0 still needs some polish, and libcurl
|
||||
might yet need some additional adjustment.
|
||||
|
||||
## Important static libcurl usage note
|
||||
|
||||
When building an application that uses the static libcurl library on Windows,
|
||||
you must add `-DCURL_STATICLIB` to your `CFLAGS`. Otherwise the linker looks
|
||||
for dynamic import symbols.
|
||||
|
||||
## Legacy Windows and SSL
|
||||
|
||||
Schannel (from Windows SSPI), is the native SSL library in Windows. However,
|
||||
Schannel in Windows <= XP is unable to connect to servers that no longer
|
||||
support the legacy handshakes and algorithms used by those versions. If you
|
||||
are using curl in one of those earlier versions of Windows you should choose
|
||||
another SSL backend such as OpenSSL.
|
||||
|
||||
# Android
|
||||
|
||||
When building curl for Android you can you CMake or curl's `configure` script.
|
||||
|
||||
Before you can build curl for Android, you need to install the Android NDK
|
||||
first. This can be done using the SDK Manager that is part of Android Studio.
|
||||
Once you have installed the Android NDK, you need to figure out where it has
|
||||
been installed and then set up some environment variables before launching
|
||||
the build.
|
||||
|
||||
Examples to compile for `aarch64` and API level 29:
|
||||
|
||||
with CMake, where `ANDROID_NDK_HOME` points into your NDK:
|
||||
|
||||
cmake . \
|
||||
-DANDROID_ABI=arm64-v8a \
|
||||
-DANDROID_PLATFORM=android-29 \
|
||||
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake" \
|
||||
-DCURL_ENABLE_SSL=OFF \
|
||||
-DCURL_USE_LIBPSL=OFF
|
||||
|
||||
with `configure`, on macOS:
|
||||
|
||||
```bash
|
||||
export ANDROID_NDK_HOME=~/Library/Android/sdk/ndk/25.1.8937393 # Point into your NDK.
|
||||
export HOST_TAG=darwin-x86_64 # Same tag for Apple Silicon. Other OS values here: https://developer.android.com/ndk/guides/other_build_systems#overview
|
||||
export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$HOST_TAG
|
||||
export AR=$TOOLCHAIN/bin/llvm-ar
|
||||
export AS=$TOOLCHAIN/bin/llvm-as
|
||||
export CC=$TOOLCHAIN/bin/aarch64-linux-android29-clang
|
||||
export CXX=$TOOLCHAIN/bin/aarch64-linux-android29-clang++
|
||||
export LD=$TOOLCHAIN/bin/ld
|
||||
export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
|
||||
export STRIP=$TOOLCHAIN/bin/llvm-strip
|
||||
```
|
||||
|
||||
When building on Linux or targeting other API levels or architectures, you need
|
||||
to adjust those variables accordingly. After that you can build curl like this:
|
||||
|
||||
./configure --host aarch64-linux-android --with-pic --disable-shared
|
||||
|
||||
Note that this does not give you SSL/TLS support. If you need SSL/TLS, you
|
||||
have to build curl with an SSL/TLS library, e.g. OpenSSL, because it is
|
||||
impossible for curl to access Android's native SSL/TLS layer. To build curl
|
||||
for Android using OpenSSL, follow the OpenSSL build instructions and then
|
||||
install `libssl.a` and `libcrypto.a` to `$TOOLCHAIN/sysroot/usr/lib` and copy
|
||||
`include/openssl` to `$TOOLCHAIN/sysroot/usr/include`. Now you can build curl
|
||||
for Android using OpenSSL like this:
|
||||
|
||||
```bash
|
||||
LIBS="-lssl -lcrypto -lc++" # For OpenSSL/BoringSSL. In general, you need to the SSL/TLS layer's transitive dependencies if you are linking statically.
|
||||
./configure --host aarch64-linux-android --with-pic --disable-shared --with-openssl="$TOOLCHAIN/sysroot/usr"
|
||||
```
|
||||
|
||||
# IBM i
|
||||
|
||||
For IBM i (formerly OS/400), you can use curl in two different ways:
|
||||
|
||||
- Natively, running in the **ILE**. The obvious use is being able to call curl
|
||||
from ILE C or RPG applications.
|
||||
- You need to build this from source. See `packages/OS400/README` for the ILE
|
||||
specific build instructions.
|
||||
- In the **PASE** environment, which runs AIX programs. curl is built as it
|
||||
would be on AIX.
|
||||
- IBM provides builds of curl in their Yum repository for PASE software.
|
||||
- To build from source, follow the Unix instructions.
|
||||
|
||||
There are some additional limitations and quirks with curl on this platform;
|
||||
they affect both environments.
|
||||
|
||||
## Multi-threading notes
|
||||
|
||||
By default, jobs in IBM i does not start with threading enabled. (Exceptions
|
||||
include interactive PASE sessions started by `QP2TERM` or SSH.) If you use
|
||||
curl in an environment without threading when options like asynchronous DNS
|
||||
were enabled, you get messages like:
|
||||
|
||||
```
|
||||
getaddrinfo() thread failed to start
|
||||
```
|
||||
|
||||
Do not panic. curl and your program are not broken. You can fix this by:
|
||||
|
||||
- Set the environment variable `QIBM_MULTI_THREADED` to `Y` before starting
|
||||
your program. This can be done at whatever scope you feel is appropriate.
|
||||
- Alternatively, start the job with the `ALWMLTTHD` parameter set to `*YES`.
|
||||
|
||||
# Cross compile
|
||||
|
||||
Download and unpack the curl package.
|
||||
|
||||
`cd` to the new directory. (e.g. `cd curl-7.12.3`)
|
||||
|
||||
Set environment variables to point to the cross-compile toolchain and call
|
||||
configure with any options you need. Be sure and specify the `--host` and
|
||||
`--build` parameters at configuration time. The following script is an example
|
||||
of cross-compiling for the IBM 405GP PowerPC processor using the toolchain on
|
||||
Linux.
|
||||
|
||||
```bash
|
||||
#! /bin/sh
|
||||
|
||||
export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin
|
||||
export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include"
|
||||
export AR=ppc_405-ar
|
||||
export AS=ppc_405-as
|
||||
export LD=ppc_405-ld
|
||||
export RANLIB=ppc_405-ranlib
|
||||
export CC=ppc_405-gcc
|
||||
export NM=ppc_405-nm
|
||||
|
||||
./configure --target=powerpc-hardhat-linux
|
||||
--host=powerpc-hardhat-linux
|
||||
--build=i586-pc-linux-gnu
|
||||
--prefix=/opt/hardhat/devkit/ppc/405/target/usr/local
|
||||
--exec-prefix=/usr/local
|
||||
```
|
||||
|
||||
The `--prefix` parameter specifies where curl gets installed. If `configure`
|
||||
completes successfully, do `make` and `make install` as usual.
|
||||
|
||||
In some cases, you may be able to simplify the above commands to as little as:
|
||||
|
||||
./configure --host=ARCH-OS
|
||||
|
||||
# REDUCING SIZE
|
||||
|
||||
There are a number of configure options that can be used to reduce the size of
|
||||
libcurl for embedded applications where binary size is an important factor.
|
||||
First, be sure to set the `CFLAGS` variable when configuring with any relevant
|
||||
compiler optimization flags to reduce the size of the binary. For gcc, this
|
||||
would mean at minimum the `-Os` option, and others like the following that
|
||||
may be relevant in some environments: `-march=X`, `-mthumb`, `-m32`,
|
||||
`-mdynamic-no-pic`, `-flto`, `-fdata-sections`, `-ffunction-sections`,
|
||||
`-fno-unwind-tables`, `-fno-asynchronous-unwind-tables`,
|
||||
`-fno-record-gcc-switches`, `-fsection-anchors`, `-fno-plt`,
|
||||
`-Wl,--gc-sections`, `-Wl,-Bsymbolic`, `-Wl,-s`,
|
||||
|
||||
For example, this is how to combine a few of these options:
|
||||
|
||||
./configure CC=gcc CFLAGS='-Os -ffunction-sections' LDFLAGS='-Wl,--gc-sections'...
|
||||
|
||||
Note that newer compilers often produce smaller code than older versions
|
||||
due to improved optimization.
|
||||
|
||||
Be sure to specify as many `--disable-` and `--without-` flags on the
|
||||
configure command-line as you can to disable all the libcurl features that you
|
||||
know your application is not going to need. Besides specifying the
|
||||
`--disable-PROTOCOL` flags for all the types of URLs your application do not
|
||||
use, here are some other flags that can reduce the size of the library by
|
||||
disabling support for some features (run `./configure --help` to see them all):
|
||||
|
||||
- `--disable-aws` (cryptographic authentication)
|
||||
- `--disable-basic-auth` (cryptographic authentication)
|
||||
- `--disable-bearer-auth` (cryptographic authentication)
|
||||
- `--disable-digest-auth` (cryptographic authentication)
|
||||
- `--disable-http-auth` (all HTTP authentication)
|
||||
- `--disable-kerberos-auth` (cryptographic authentication)
|
||||
- `--disable-negotiate-auth` (cryptographic authentication)
|
||||
- `--disable-ntlm` (NTLM authentication)
|
||||
- `--disable-alt-svc` (HTTP Alt-Svc)
|
||||
- `--disable-ares` (the C-ARES DNS library)
|
||||
- `--disable-cookies` (HTTP cookies)
|
||||
- `--disable-dateparse` (date parsing for time conditionals)
|
||||
- `--disable-dnsshuffle` (internal server load spreading)
|
||||
- `--disable-doh` (DNS-over-HTTP)
|
||||
- `--disable-form-api` (POST form API)
|
||||
- `--disable-get-easy-options` (lookup easy options at runtime)
|
||||
- `--disable-headers-api` (API to access headers)
|
||||
- `--disable-hsts` (HTTP Strict Transport Security)
|
||||
- `--disable-ipv6` (IPv6)
|
||||
- `--disable-libcurl-option` (--libcurl C code generation support)
|
||||
- `--disable-manual` (--manual built-in documentation)
|
||||
- `--disable-mime` (MIME API)
|
||||
- `--disable-netrc` (.netrc file)
|
||||
- `--disable-progress-meter` (graphical progress meter in library)
|
||||
- `--disable-proxy` (HTTP and SOCKS proxies)
|
||||
- `--disable-socketpair` (socketpair for asynchronous name resolving)
|
||||
- `--disable-threaded-resolver` (threaded name resolver)
|
||||
- `--disable-tls-srp` (Secure Remote Password authentication for TLS)
|
||||
- `--disable-unix-sockets` (Unix sockets)
|
||||
- `--disable-verbose` (eliminates debugging strings and error code strings)
|
||||
- `--disable-versioned-symbols` (versioned symbols)
|
||||
- `--enable-symbol-hiding` (eliminates unneeded symbols in the shared library)
|
||||
- `--without-brotli` (Brotli on-the-fly decompression)
|
||||
- `--without-libpsl` (Public Suffix List in cookies)
|
||||
- `--without-nghttp2` (HTTP/2 using nghttp2)
|
||||
- `--without-ngtcp2` (HTTP/2 using ngtcp2)
|
||||
- `--without-zstd` (Zstd on-the-fly decompression)
|
||||
- `--without-libidn2` (internationalized domain names)
|
||||
- `--without-librtmp` (RTMP)
|
||||
- `--without-ssl` (SSL/TLS)
|
||||
- `--without-zlib` (gzip/deflate on-the-fly decompression)
|
||||
|
||||
Be sure also to strip debugging symbols from your binaries after compiling
|
||||
using 'strip' or an option like `-s`. If space is really tight, you may be able
|
||||
to gain a few bytes by removing some unneeded sections of the shared library
|
||||
using the -R option to objcopy (e.g. the .comment section).
|
||||
|
||||
Using these techniques it is possible to create a basic HTTP-only libcurl
|
||||
shared library for i386 Linux platforms that is only 137 KiB in size
|
||||
(as of libcurl version 8.13.0, using gcc 14.2.0).
|
||||
|
||||
You may find that statically linking libcurl to your application results in a
|
||||
lower total size than dynamically linking.
|
||||
|
||||
The curl test harness can detect the use of some, but not all, of the
|
||||
`--disable` statements suggested above. Use of these can cause tests relying
|
||||
on those features to fail. The test harness can be manually forced to skip the
|
||||
relevant tests by specifying certain key words on the `runtests.pl` command
|
||||
line. Following is a list of appropriate key words for those configure options
|
||||
that are not automatically detected:
|
||||
|
||||
- `--disable-cookies` !cookies
|
||||
- `--disable-dateparse` !RETRY-AFTER !`CURLOPT_TIMECONDITION` !`CURLINFO_FILETIME` !`If-Modified-Since` !`curl_getdate` !`-z`
|
||||
- `--disable-libcurl-option` !`--libcurl`
|
||||
- `--disable-verbose` !verbose\ logs
|
||||
|
||||
# Ports
|
||||
|
||||
This is a probably incomplete list of known CPU architectures and operating
|
||||
systems that curl has been compiled for. If you know a system curl compiles
|
||||
and runs on, that is not listed, please let us know.
|
||||
|
||||
## 104 Operating Systems
|
||||
|
||||
AIX, AmigaOS, Android, ArcoOS, Aros, Atari FreeMiNT, BeOS, Blackberry
|
||||
10, Blackberry Tablet OS, Cell OS, CheriBSD, Chrome OS, Cisco IOS,
|
||||
DG/UX, DR DOS, Dragonfly BSD, eCOS, FreeBSD, FreeDOS, FreeRTOS, Fuchsia,
|
||||
Garmin OS, Genode, Haiku, HardenedBSD, HP-UX, Hurd, IBM I, illumos,
|
||||
Integrity, iOS, ipadOS, IRIX, Linux, Lua RTOS, Mac OS 9, macOS, Maemo,
|
||||
Mbed, Meego, Micrium, MINIX, Minoca, Moblin, MorphOS, MPE/iX, MS-DOS,
|
||||
NCR MP-RAS, NetBSD, Netware, NextStep, Nintendo 3DS Nintendo Switch,
|
||||
NonStop OS, NuttX, OpenBSD, OpenStep, Orbis OS, OS/2, OS21, Plan 9,
|
||||
PlayStation Portable, QNX, Qubes OS, ReactOS, Redox, RISC OS, ROS,
|
||||
RTEMS, Sailfish OS, SCO Unix, Serenity, SINIX-Z, SkyOS, software,
|
||||
Solaris, Sortix, SunOS, Syllable OS, Symbian, Tizen, TPF, Tru64, tvOS,
|
||||
ucLinux, Ultrix, UNICOS, UnixWare, VMS, vxWorks, watchOS, Wear OS,
|
||||
WebOS, Wii system Wii U, Windows CE, Windows, Xbox System, Xenix, z/OS,
|
||||
z/TPF, z/VM, z/VSE, Zephyr
|
||||
|
||||
## 28 CPU Architectures
|
||||
|
||||
Alpha, ARC, ARM, AVR32, C-SKY, CompactRISC, Elbrus, ETRAX, HP-PA, Itanium,
|
||||
LoongArch, m68k, m88k, MicroBlaze, MIPS, Nios, OpenRISC, POWER, PowerPC,
|
||||
RISC-V, s390, SH4, SPARC, Tilera, VAX, x86, Xtensa, z/arch
|
||||
@@ -1,63 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# curl internals
|
||||
|
||||
The canonical libcurl internals documentation is now in the [everything
|
||||
curl](https://everything.curl.dev/internals) book. This file lists supported
|
||||
versions of libs and build tools.
|
||||
|
||||
## Portability
|
||||
|
||||
We write curl and libcurl to compile with C89 compilers on 32-bit and up
|
||||
machines. Most of libcurl assumes more or less POSIX compliance but that is
|
||||
not a requirement.
|
||||
|
||||
We write libcurl to build and work with lots of third party tools, and we
|
||||
want it to remain functional and buildable with these and later versions
|
||||
(older versions may still work but is not what we work hard to maintain):
|
||||
|
||||
## Dependencies
|
||||
|
||||
We aim to support these or later versions.
|
||||
|
||||
- OpenSSL 1.0.2a
|
||||
- LibreSSL 2.9.1
|
||||
- GnuTLS 3.1.10
|
||||
- zlib 1.2.5.2
|
||||
- libssh2 1.2.8
|
||||
- c-ares 1.6.0
|
||||
- libssh 0.9.0
|
||||
- libidn2 2.0.0
|
||||
- wolfSSL 3.4.6
|
||||
- OpenLDAP 2.0
|
||||
- MIT Kerberos 1.2.4
|
||||
- Heimdal ?
|
||||
- nghttp2 1.15.0
|
||||
- Winsock 2.2 (on Windows 95+ and Windows CE .NET 4.1+)
|
||||
|
||||
## Build tools
|
||||
|
||||
When writing code (mostly for generating stuff included in release tarballs)
|
||||
we use a few "build tools" and we make sure that we remain functional with
|
||||
these versions:
|
||||
|
||||
- GNU Libtool 1.4.2
|
||||
- GNU Autoconf 2.59
|
||||
- GNU Automake 1.7
|
||||
- GNU M4 1.4
|
||||
- perl 5.8
|
||||
- roffit 0.5
|
||||
- cmake 3.7
|
||||
|
||||
Library Symbols
|
||||
===============
|
||||
|
||||
All symbols used internally in libcurl must use a `Curl_` prefix if they are
|
||||
used in more than a single file. Single-file symbols must be made static.
|
||||
Public ("exported") symbols must use a `curl_` prefix. Public API functions
|
||||
are marked with `CURL_EXTERN` in the public header files so that all others
|
||||
can be hidden on platforms where this is possible.
|
||||
@@ -1,133 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# IPFS
|
||||
For an overview about IPFS, visit the [IPFS project site](https://ipfs.tech/).
|
||||
|
||||
In IPFS there are two protocols. IPFS and IPNS (their workings are explained in detail [here](https://docs.ipfs.tech/concepts/)). The ideal way to access data on the IPFS network is through those protocols. For example to access the Big Buck Bunny video the ideal way to access it is like: `ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi`
|
||||
|
||||
## IPFS Gateways
|
||||
|
||||
IPFS Gateway acts as a bridge between traditional HTTP clients and IPFS.
|
||||
IPFS Gateway specifications of HTTP semantics can be found [here](https://specs.ipfs.tech/http-gateways/).
|
||||
|
||||
### Deserialized responses
|
||||
|
||||
By default, a gateway acts as a bridge between traditional HTTP clients and IPFS and performs necessary hash verification and deserialization. Through such gateway, users can download files, directories, and other content-addressed data stored with IPFS or IPNS as if they were stored in a traditional web server.
|
||||
|
||||
### Verifiable responses
|
||||
|
||||
By explicitly requesting [application/vnd.ipld.raw](https://www.iana.org/assignments/media-types/application/vnd.ipld.raw) or [application/vnd.ipld.car](https://www.iana.org/assignments/media-types/application/vnd.ipld.car) responses, by means defined in [Trustless Gateway Specification](https://specs.ipfs.tech/http-gateways/trustless-gateway/), the user is able to fetch raw content-addressed data and [perform hash verification themselves](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval).
|
||||
|
||||
This enables users to use untrusted, public gateways without worrying they might return invalid/malicious bytes.
|
||||
|
||||
## IPFS and IPNS protocol handling
|
||||
|
||||
There are various ways to access data from the IPFS network. One such way is
|
||||
through the concept of public
|
||||
"[gateways](https://docs.ipfs.tech/concepts/ipfs-gateway/#overview)". The
|
||||
short version is that entities can offer gateway services. An example here
|
||||
that is hosted by Protocol Labs (who also makes IPFS) is `dweb.link` and
|
||||
`ipfs.io`. Both sites expose gateway functionality. Getting a file through
|
||||
`ipfs.io` looks like this:
|
||||
`https://ipfs.io/ipfs/bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi`
|
||||
|
||||
If you were to be [running your own IPFS
|
||||
node](https://docs.ipfs.tech/how-to/command-line-quick-start/) then you, by
|
||||
default, also have a [local gateway](https://specs.ipfs.tech/http-gateways/)
|
||||
running. In its default configuration the earlier example would then also work
|
||||
in this link:
|
||||
|
||||
`http://127.0.0.1:8080/ipfs/bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi`
|
||||
|
||||
## cURL handling of the IPFS protocols
|
||||
|
||||
The IPFS integration in cURL hides this gateway logic for you. Instead of
|
||||
providing a full URL to a file on IPFS like this:
|
||||
|
||||
```
|
||||
curl http://127.0.0.1:8080/ipfs/bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi
|
||||
```
|
||||
|
||||
You can provide it with the IPFS protocol instead:
|
||||
```
|
||||
curl ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi
|
||||
```
|
||||
|
||||
With the IPFS protocol way of asking a file, cURL still needs to know the
|
||||
gateway. curl essentially just rewrites the IPFS based URL to a gateway URL.
|
||||
|
||||
### IPFS_GATEWAY environment variable
|
||||
|
||||
If the `IPFS_GATEWAY` environment variable is found, its value is used as
|
||||
gateway.
|
||||
|
||||
### Automatic gateway detection
|
||||
|
||||
When you provide no additional details to cURL then it:
|
||||
|
||||
1. First looks for the `IPFS_GATEWAY` environment variable and use that if it
|
||||
is set.
|
||||
2. Looks for the file: `~/.ipfs/gateway`. If it can find that file then it
|
||||
means that you have a local gateway running and that file contains the URL
|
||||
to your local gateway.
|
||||
|
||||
If cURL fails, you are presented with an error message and a link to this page
|
||||
to the option most applicable to solving the issue.
|
||||
|
||||
### `--ipfs-gateway` argument
|
||||
|
||||
You can also provide a `--ipfs-gateway` argument to cURL. This overrules any
|
||||
other gateway setting. curl does not fallback to the other options if the
|
||||
provided gateway did not work.
|
||||
|
||||
## Gateway redirects
|
||||
|
||||
A gateway could redirect to another place. For example, `dweb.link` redirects
|
||||
[path based](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway)
|
||||
requests to [subdomain
|
||||
based](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway)
|
||||
ones. A request using:
|
||||
|
||||
curl ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi --ipfs-gateway https://dweb.link
|
||||
|
||||
Which would be translated to:
|
||||
|
||||
https://dweb.link/ipfs/bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi
|
||||
|
||||
redirects to:
|
||||
|
||||
https://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi.ipfs.dweb.link
|
||||
|
||||
If you trust this behavior from your gateway of choice then passing the `-L`
|
||||
option follows the redirect.
|
||||
|
||||
## Error messages and hints
|
||||
|
||||
Depending on the arguments, cURL could present the user with an error.
|
||||
|
||||
### Gateway file and environment variable
|
||||
|
||||
cURL tried to look for the file: `~/.ipfs/gateway` but could not find it. It
|
||||
also tried to look for the `IPFS_GATEWAY` environment variable but could not
|
||||
find that either. This happens when no extra arguments are passed to cURL and
|
||||
letting it try to figure it out [automatically](#automatic-gateway-detection).
|
||||
|
||||
Any IPFS implementation that has gateway support should expose its URL in
|
||||
`~/.ipfs/gateway`. If you are already running a gateway, make sure it exposes
|
||||
the file where cURL expects to find it.
|
||||
|
||||
Alternatively you could set the `IPFS_GATEWAY` environment variable or pass
|
||||
the `--ipfs-gateway` flag to the cURL command.
|
||||
|
||||
### Malformed gateway URL
|
||||
|
||||
The command executed evaluates in an invalid URL. This could be anywhere in
|
||||
the URL, but a likely point is a wrong gateway URL.
|
||||
|
||||
Inspect the URL set via the `IPFS_GATEWAY` environment variable or passed with
|
||||
the `--ipfs-gateway` flag. Alternatively opt to go for the
|
||||
[automatic](#automatic-gateway-detection) gateway detection.
|
||||
@@ -1,653 +0,0 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Known Bugs
|
||||
|
||||
These are problems and bugs known to exist at the time of this release. Feel
|
||||
free to join in and help us correct one or more of these. Also be sure to
|
||||
check the changelog of the current development status, as one or more of these
|
||||
problems may have been fixed or changed somewhat since this was written.
|
||||
|
||||
1. HTTP
|
||||
|
||||
2. TLS
|
||||
2.1 IMAPS connection fails with Rustls error
|
||||
2.5 Client cert handling with Issuer DN differs between backends
|
||||
2.7 Client cert (MTLS) issues with Schannel
|
||||
2.11 Schannel TLS 1.2 handshake bug in old Windows versions
|
||||
2.13 CURLOPT_CERTINFO results in CURLE_OUT_OF_MEMORY with Schannel
|
||||
2.14 mbedTLS and CURLE_AGAIN handling
|
||||
|
||||
3. Email protocols
|
||||
3.1 IMAP SEARCH ALL truncated response
|
||||
3.2 No disconnect command
|
||||
3.4 AUTH PLAIN for SMTP is not working on all servers
|
||||
3.5 APOP authentication fails on POP3
|
||||
3.6 POP3 issue when reading small chunks
|
||||
|
||||
4. Command line
|
||||
4.1 -T /dev/stdin may upload with an incorrect content length
|
||||
4.2 -T - always uploads chunked
|
||||
|
||||
5. Build and portability issues
|
||||
5.1 OS400 port requires deprecated IBM library
|
||||
5.2 curl-config --libs contains private details
|
||||
5.3 LDFLAGS passed too late making libs linked incorrectly
|
||||
5.6 Cygwin: make install installs curl-config.1 twice
|
||||
5.11 configure --with-gssapi with Heimdal is ignored on macOS
|
||||
5.12 flaky CI builds
|
||||
5.13 long paths are not fully supported on Windows
|
||||
5.15 Unicode on Windows
|
||||
|
||||
6. Authentication
|
||||
6.2 MIT Kerberos for Windows build
|
||||
6.3 NTLM in system context uses wrong name
|
||||
6.5 NTLM does not support password with Unicode 'SECTION SIGN' character
|
||||
6.6 libcurl can fail to try alternatives with --proxy-any
|
||||
6.7 Do not clear digest for single realm
|
||||
6.8 Heimdal memory leaks
|
||||
6.9 SHA-256 digest not supported in Windows SSPI builds
|
||||
6.10 curl never completes Negotiate over HTTP
|
||||
6.11 Negotiate on Windows fails
|
||||
6.13 Negotiate against Hadoop HDFS
|
||||
|
||||
7. FTP
|
||||
7.4 FTP with ACCT
|
||||
7.12 FTPS directory listing hangs on Windows with Schannel
|
||||
|
||||
9. SFTP and SCP
|
||||
9.1 SFTP does not do CURLOPT_POSTQUOTE correct
|
||||
9.2 wolfssh: publickey auth does not work
|
||||
9.3 Remote recursive folder creation with SFTP
|
||||
9.4 libssh blocking and infinite loop problem
|
||||
9.5 Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!"
|
||||
9.6 wolfssh: all tests fail
|
||||
|
||||
10. Connection
|
||||
10.1 --interface with link-scoped IPv6 address
|
||||
10.2 Does not acknowledge getaddrinfo sorting policy
|
||||
|
||||
11. Internals
|
||||
11.1 gssapi library name + version is missing in curl_version_info()
|
||||
11.2 error buffer not set if connection to multiple addresses fails
|
||||
11.4 HTTP test server 'connection-monitor' problems
|
||||
11.5 Connection information when using TCP Fast Open
|
||||
11.6 test cases sometimes timeout
|
||||
11.7 CURLOPT_CONNECT_TO does not work for HTTPS proxy
|
||||
11.8 WinIDN test failures
|
||||
11.9 setting a disabled option should return CURLE_NOT_BUILT_IN
|
||||
|
||||
12. LDAP
|
||||
12.1 OpenLDAP hangs after returning results
|
||||
12.2 LDAP on Windows does authentication wrong?
|
||||
12.3 LDAP on Windows does not work
|
||||
12.4 LDAPS requests to ActiveDirectory server hang
|
||||
|
||||
13. TCP/IP
|
||||
13.2 Trying local ports fails on Windows
|
||||
|
||||
15. CMake
|
||||
15.1 cmake outputs: no version information available
|
||||
15.6 uses -lpthread instead of Threads::Threads
|
||||
15.7 generated .pc file contains strange entries
|
||||
15.13 CMake build with MIT Kerberos does not work
|
||||
|
||||
16. aws-sigv4
|
||||
16.2 aws-sigv4 does not handle multipart/form-data correctly
|
||||
|
||||
17. HTTP/2
|
||||
17.1 HTTP/2 prior knowledge over proxy
|
||||
17.2 HTTP/2 frames while in the connection pool kill reuse
|
||||
17.3 ENHANCE_YOUR_CALM causes infinite retries
|
||||
17.4 HTTP/2 + TLS spends a lot of time in recv
|
||||
|
||||
18. HTTP/3
|
||||
18.1 connection migration does not work
|
||||
18.2 quiche: QUIC connection is draining
|
||||
|
||||
19. RTSP
|
||||
19.1 Some methods do not support response bodies
|
||||
|
||||
==============================================================================
|
||||
|
||||
1. HTTP
|
||||
|
||||
2. TLS
|
||||
|
||||
2.1 IMAPS connection fails with Rustls error
|
||||
|
||||
https://github.com/curl/curl/issues/10457
|
||||
|
||||
2.5 Client cert handling with Issuer DN differs between backends
|
||||
|
||||
When the specified client certificate does not match any of the
|
||||
server-specified DNs, the OpenSSL and GnuTLS backends behave differently.
|
||||
The github discussion may contain a solution.
|
||||
|
||||
See https://github.com/curl/curl/issues/1411
|
||||
|
||||
2.7 Client cert (MTLS) issues with Schannel
|
||||
|
||||
See https://github.com/curl/curl/issues/3145
|
||||
|
||||
2.11 Schannel TLS 1.2 handshake bug in old Windows versions
|
||||
|
||||
In old versions of Windows such as 7 and 8.1 the Schannel TLS 1.2 handshake
|
||||
implementation likely has a bug that can rarely cause the key exchange to
|
||||
fail, resulting in error SEC_E_BUFFER_TOO_SMALL or SEC_E_MESSAGE_ALTERED.
|
||||
|
||||
https://github.com/curl/curl/issues/5488
|
||||
|
||||
2.13 CURLOPT_CERTINFO results in CURLE_OUT_OF_MEMORY with Schannel
|
||||
|
||||
https://github.com/curl/curl/issues/8741
|
||||
|
||||
2.14 mbedTLS and CURLE_AGAIN handling
|
||||
|
||||
https://github.com/curl/curl/issues/15801
|
||||
|
||||
3. Email protocols
|
||||
|
||||
3.1 IMAP SEARCH ALL truncated response
|
||||
|
||||
IMAP "SEARCH ALL" truncates output on large boxes. "A quick search of the
|
||||
code reveals that pingpong.c contains some truncation code, at line 408, when
|
||||
it deems the server response to be too large truncating it to 40 characters"
|
||||
https://curl.se/bug/view.cgi?id=1366
|
||||
|
||||
3.2 No disconnect command
|
||||
|
||||
The disconnect commands (LOGOUT and QUIT) may not be sent by IMAP, POP3 and
|
||||
SMTP if a failure occurs during the authentication phase of a connection.
|
||||
|
||||
3.4 AUTH PLAIN for SMTP is not working on all servers
|
||||
|
||||
Specifying "--login-options AUTH=PLAIN" on the command line does not seem to
|
||||
work correctly.
|
||||
|
||||
See https://github.com/curl/curl/issues/4080
|
||||
|
||||
3.5 APOP authentication fails on POP3
|
||||
|
||||
See https://github.com/curl/curl/issues/10073
|
||||
|
||||
3.6 POP3 issue when reading small chunks
|
||||
|
||||
CURL_DBG_SOCK_RMAX=4 ./runtests.pl -v 982
|
||||
|
||||
See https://github.com/curl/curl/issues/12063
|
||||
|
||||
4. Command line
|
||||
|
||||
4.1 -T /dev/stdin may upload with an incorrect content length
|
||||
|
||||
-T stats the path to figure out its size in bytes to use it as Content-Length
|
||||
if it is a regular file.
|
||||
|
||||
The problem with that is that, on BSDs and some other UNIXes (not Linux),
|
||||
open(path) may not give you a file descriptor with a 0 offset from the start
|
||||
of the file.
|
||||
|
||||
See https://github.com/curl/curl/issues/12177
|
||||
|
||||
4.2 -T - always uploads chunked
|
||||
|
||||
When the `<` shell operator is used. curl should realise that stdin is a
|
||||
regular file in this case, and that it can do a non-chunked upload, like it
|
||||
would do if you used -T file.
|
||||
|
||||
See https://github.com/curl/curl/issues/12171
|
||||
|
||||
5. Build and portability issues
|
||||
|
||||
5.1 OS400 port requires deprecated IBM library
|
||||
|
||||
curl for OS400 requires QADRT to build, which provides ASCII wrappers for
|
||||
libc/POSIX functions in the ILE, but IBM no longer supports or even offers
|
||||
this library to download.
|
||||
|
||||
See https://github.com/curl/curl/issues/5176
|
||||
|
||||
5.2 curl-config --libs contains private details
|
||||
|
||||
"curl-config --libs" include details set in LDFLAGS when configure is run
|
||||
that might be needed only for building libcurl. Further, curl-config --cflags
|
||||
suffers from the same effects with CFLAGS/CPPFLAGS.
|
||||
|
||||
5.3 LDFLAGS passed too late making libs linked incorrectly
|
||||
|
||||
Compiling latest curl on HP-UX and linking against a custom OpenSSL (which is
|
||||
on the default loader/linker path), fails because the generated Makefile has
|
||||
LDFLAGS passed on after LIBS.
|
||||
|
||||
See https://github.com/curl/curl/issues/14893
|
||||
|
||||
5.6 Cygwin: make install installs curl-config.1 twice
|
||||
|
||||
https://github.com/curl/curl/issues/8839
|
||||
|
||||
5.11 configure --with-gssapi with Heimdal is ignored on macOS
|
||||
|
||||
... unless you also pass --with-gssapi-libs
|
||||
|
||||
https://github.com/curl/curl/issues/3841
|
||||
|
||||
5.12 flaky CI builds
|
||||
|
||||
We run many CI builds for each commit and PR on github, and especially a
|
||||
number of the Windows builds are flaky. This means that we rarely get all CI
|
||||
builds go green and complete without errors. This is unfortunate as it makes
|
||||
us sometimes miss actual build problems and it is surprising to newcomers to
|
||||
the project who (rightfully) do not expect this.
|
||||
|
||||
See https://github.com/curl/curl/issues/6972
|
||||
|
||||
5.13 long paths are not fully supported on Windows
|
||||
|
||||
curl on Windows cannot access long paths (paths longer than 260 characters).
|
||||
However, as a workaround, the Windows path prefix \\?\ which disables all
|
||||
path interpretation may work to allow curl to access the path. For example:
|
||||
\\?\c:\longpath.
|
||||
|
||||
See https://github.com/curl/curl/issues/8361
|
||||
|
||||
5.15 Unicode on Windows
|
||||
|
||||
Passing in a Unicode filename with -o:
|
||||
|
||||
https://github.com/curl/curl/issues/11461
|
||||
|
||||
Passing in Unicode character with -d:
|
||||
|
||||
https://github.com/curl/curl/issues/12231
|
||||
|
||||
Windows Unicode builds use homedir in current locale
|
||||
|
||||
The Windows Unicode builds of curl use the current locale, but expect Unicode
|
||||
UTF-8 encoded paths for internal use such as open, access and stat. The
|
||||
user's home directory is retrieved via curl_getenv in the current locale and
|
||||
not as UTF-8 encoded Unicode.
|
||||
|
||||
See https://github.com/curl/curl/pull/7252 and
|
||||
https://github.com/curl/curl/pull/7281
|
||||
|
||||
Cannot handle Unicode arguments in non-Unicode builds on Windows
|
||||
|
||||
If a URL or filename cannot be encoded using the user's current codepage then
|
||||
it can only be encoded properly in the Unicode character set. Windows uses
|
||||
UTF-16 encoding for Unicode and stores it in wide characters, however curl
|
||||
and libcurl are not equipped for that at the moment except when built with
|
||||
_UNICODE and UNICODE defined. Except for Cygwin, Windows cannot use UTF-8 as
|
||||
a locale.
|
||||
|
||||
https://curl.se/bug/?i=345
|
||||
https://curl.se/bug/?i=731
|
||||
https://curl.se/bug/?i=3747
|
||||
|
||||
NTLM authentication and Unicode
|
||||
|
||||
NTLM authentication involving Unicode username or password only works
|
||||
properly if built with UNICODE defined together with the Schannel backend.
|
||||
The original problem was mentioned in:
|
||||
https://curl.se/mail/lib-2009-10/0024.html
|
||||
https://curl.se/bug/view.cgi?id=896
|
||||
|
||||
The Schannel version verified to work as mentioned in
|
||||
https://curl.se/mail/lib-2012-07/0073.html
|
||||
|
||||
6. Authentication
|
||||
|
||||
6.2 MIT Kerberos for Windows build
|
||||
|
||||
libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's
|
||||
library header files exporting symbols/macros that should be kept private to
|
||||
the KfW library. See ticket #5601 at https://krbdev.mit.edu/rt/
|
||||
|
||||
6.3 NTLM in system context uses wrong name
|
||||
|
||||
NTLM authentication using SSPI (on Windows) when (lib)curl is running in
|
||||
"system context" makes it use wrong(?) username - at least when compared to
|
||||
what winhttp does. See https://curl.se/bug/view.cgi?id=535
|
||||
|
||||
6.5 NTLM does not support password with Unicode 'SECTION SIGN' character
|
||||
|
||||
https://en.wikipedia.org/wiki/Section_sign
|
||||
https://codepoints.net/U+00A7 SECTION SIGN
|
||||
https://github.com/curl/curl/issues/2120
|
||||
|
||||
6.6 libcurl can fail to try alternatives with --proxy-any
|
||||
|
||||
When connecting via a proxy using --proxy-any, a failure to establish an
|
||||
authentication causes libcurl to abort trying other options if the failed
|
||||
method has a higher preference than the alternatives. As an example,
|
||||
--proxy-any against a proxy which advertise Negotiate and NTLM, but which
|
||||
fails to set up Kerberos authentication does not proceed to try
|
||||
authentication using NTLM.
|
||||
|
||||
https://github.com/curl/curl/issues/876
|
||||
|
||||
6.7 Do not clear digest for single realm
|
||||
|
||||
https://github.com/curl/curl/issues/3267
|
||||
|
||||
6.8 Heimdal memory leaks
|
||||
|
||||
Running test 2077 and 2078 with curl built to do GSS with Heimdal causes
|
||||
valgrind errors (memory leak).
|
||||
|
||||
https://github.com/curl/curl/issues/14446
|
||||
|
||||
6.9 SHA-256 digest not supported in Windows SSPI builds
|
||||
|
||||
Windows builds of curl that have SSPI enabled use the native Windows API calls
|
||||
to create authentication strings. The call to InitializeSecurityContext fails
|
||||
with SEC_E_QOP_NOT_SUPPORTED which causes curl to fail with CURLE_AUTH_ERROR.
|
||||
|
||||
Microsoft does not document supported digest algorithms and that SEC_E error
|
||||
code is not a documented error for InitializeSecurityContext (digest).
|
||||
|
||||
https://github.com/curl/curl/issues/6302
|
||||
|
||||
6.10 curl never completes Negotiate over HTTP
|
||||
|
||||
Apparently it is not working correctly...?
|
||||
|
||||
See https://github.com/curl/curl/issues/5235
|
||||
|
||||
6.11 Negotiate on Windows fails
|
||||
|
||||
When using --negotiate (or NTLM) with curl on Windows, SSL/TLS handshake
|
||||
fails despite having a valid kerberos ticket cached. Works without any issue
|
||||
in Unix/Linux.
|
||||
|
||||
https://github.com/curl/curl/issues/5881
|
||||
|
||||
6.13 Negotiate authentication against Hadoop HDFS
|
||||
|
||||
https://github.com/curl/curl/issues/8264
|
||||
|
||||
7. FTP
|
||||
|
||||
7.4 FTP with ACCT
|
||||
|
||||
When doing an operation over FTP that requires the ACCT command (but not when
|
||||
logging in), the operation fails since libcurl does not detect this and thus
|
||||
fails to issue the correct command: https://curl.se/bug/view.cgi?id=635
|
||||
|
||||
7.12 FTPS server compatibility on Windows with Schannel
|
||||
|
||||
FTPS is not widely used with the Schannel TLS backend and so there may be
|
||||
more bugs compared to other TLS backends such as OpenSSL. In the past users
|
||||
have reported hanging and failed connections. It is likely some changes to
|
||||
curl since then fixed the issues. None of the reported issues can be
|
||||
reproduced any longer.
|
||||
|
||||
If you encounter an issue connecting to your server via FTPS with the latest
|
||||
curl and Schannel then please search for open issues or file a new issue.
|
||||
|
||||
9. SFTP and SCP
|
||||
|
||||
9.1 SFTP does not do CURLOPT_POSTQUOTE correct
|
||||
|
||||
When libcurl sends CURLOPT_POSTQUOTE commands when connected to an SFTP
|
||||
server using the multi interface, the commands are not being sent correctly
|
||||
and instead the connection is "cancelled" (the operation is considered done)
|
||||
prematurely. There is a half-baked (busy-looping) patch provided in the bug
|
||||
report but it cannot be accepted as-is. See
|
||||
https://curl.se/bug/view.cgi?id=748
|
||||
|
||||
9.2 wolfssh: publickey auth does not work
|
||||
|
||||
When building curl to use the wolfSSH backend for SFTP, the publickey
|
||||
authentication does not work. This is simply functionality not written for curl
|
||||
yet, the necessary API for make this work is provided by wolfSSH.
|
||||
|
||||
See https://github.com/curl/curl/issues/4820
|
||||
|
||||
9.3 Remote recursive folder creation with SFTP
|
||||
|
||||
On this servers, the curl fails to create directories on the remote server
|
||||
even when the CURLOPT_FTP_CREATE_MISSING_DIRS option is set.
|
||||
|
||||
See https://github.com/curl/curl/issues/5204
|
||||
|
||||
9.4 libssh blocking and infinite loop problem
|
||||
|
||||
In the SSH_SFTP_INIT state for libssh, the ssh session working mode is set to
|
||||
blocking mode. If the network is suddenly disconnected during sftp
|
||||
transmission, curl is stuck, even if curl is configured with a timeout.
|
||||
|
||||
https://github.com/curl/curl/issues/8632
|
||||
|
||||
9.5 Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!"
|
||||
|
||||
Running SCP and SFTP tests on Cygwin makes this warning message appear.
|
||||
|
||||
https://github.com/curl/curl/issues/11244
|
||||
|
||||
9.6 wolfssh: all tests fail
|
||||
|
||||
Something fundamental stops them all from working properly.
|
||||
|
||||
https://github.com/curl/curl/issues/16794
|
||||
|
||||
10. Connection
|
||||
|
||||
10.1 --interface with link-scoped IPv6 address
|
||||
|
||||
When you give the `--interface` option telling curl to use a specific
|
||||
interface for its outgoing traffic in combination with an IPv6 address in the
|
||||
URL that uses a link-local scope, curl might pick the wrong address from the
|
||||
named interface and the subsequent transfer fails.
|
||||
|
||||
Example command line:
|
||||
|
||||
curl --interface eth0 'http://[fe80:928d:xxff:fexx:xxxx]/'
|
||||
|
||||
The fact that the given IP address is link-scoped should probably be used as
|
||||
input to somehow make curl make a better choice for this.
|
||||
|
||||
https://github.com/curl/curl/issues/14782
|
||||
|
||||
10.2 Does not acknowledge getaddrinfo sorting policy
|
||||
|
||||
Even if a user edits /etc/gai.conf to prefer IPv4, curl still prefers and
|
||||
tries IPv6 addresses first.
|
||||
|
||||
https://github.com/curl/curl/issues/16718
|
||||
|
||||
11. Internals
|
||||
|
||||
11.1 gssapi library name + version is missing in curl_version_info()
|
||||
|
||||
The struct needs to be expanded and code added to store this info.
|
||||
|
||||
See https://github.com/curl/curl/issues/13492
|
||||
|
||||
11.2 error buffer not set if connection to multiple addresses fails
|
||||
|
||||
If you ask libcurl to resolve a hostname like example.com to IPv6 addresses
|
||||
when you only have IPv4 connectivity. libcurl fails with
|
||||
CURLE_COULDNT_CONNECT, but the error buffer set by CURLOPT_ERRORBUFFER
|
||||
remains empty. Issue: https://github.com/curl/curl/issues/544
|
||||
|
||||
11.4 HTTP test server 'connection-monitor' problems
|
||||
|
||||
The 'connection-monitor' feature of the sws HTTP test server does not work
|
||||
properly if some tests are run in unexpected order. Like 1509 and then 1525.
|
||||
|
||||
See https://github.com/curl/curl/issues/868
|
||||
|
||||
11.5 Connection information when using TCP Fast Open
|
||||
|
||||
CURLINFO_LOCAL_PORT (and possibly a few other) fails when TCP Fast Open is
|
||||
enabled.
|
||||
|
||||
See https://github.com/curl/curl/issues/1332 and
|
||||
https://github.com/curl/curl/issues/4296
|
||||
|
||||
11.6 test cases sometimes timeout
|
||||
|
||||
Occasionally, one of the tests timeouts. Inexplicably.
|
||||
|
||||
See https://github.com/curl/curl/issues/13350
|
||||
|
||||
11.7 CURLOPT_CONNECT_TO does not work for HTTPS proxy
|
||||
|
||||
It is unclear if the same option should even cover the proxy connection or if
|
||||
if requires a separate option.
|
||||
|
||||
See https://github.com/curl/curl/issues/14481
|
||||
|
||||
11.8 WinIDN test failures
|
||||
|
||||
Test 165 disabled when built with WinIDN.
|
||||
|
||||
11.9 setting a disabled option should return CURLE_NOT_BUILT_IN
|
||||
|
||||
When curl has been built with specific features or protocols disabled,
|
||||
setting such options with curl_easy_setopt() should rather return
|
||||
CURLE_NOT_BUILT_IN instead of CURLE_UNKNOWN_OPTION to signal the difference
|
||||
to the application
|
||||
|
||||
See https://github.com/curl/curl/issues/15472
|
||||
|
||||
12. LDAP
|
||||
|
||||
12.1 OpenLDAP hangs after returning results
|
||||
|
||||
By configuration defaults, OpenLDAP automatically chase referrals on
|
||||
secondary socket descriptors. The OpenLDAP backend is asynchronous and thus
|
||||
should monitor all socket descriptors involved. Currently, these secondary
|
||||
descriptors are not monitored, causing OpenLDAP library to never receive
|
||||
data from them.
|
||||
|
||||
As a temporary workaround, disable referrals chasing by configuration.
|
||||
|
||||
The fix is not easy: proper automatic referrals chasing requires a
|
||||
synchronous bind callback and monitoring an arbitrary number of socket
|
||||
descriptors for a single easy handle (currently limited to 5).
|
||||
|
||||
Generic LDAP is synchronous: OK.
|
||||
|
||||
See https://github.com/curl/curl/issues/622 and
|
||||
https://curl.se/mail/lib-2016-01/0101.html
|
||||
|
||||
12.2 LDAP on Windows does authentication wrong?
|
||||
|
||||
https://github.com/curl/curl/issues/3116
|
||||
|
||||
12.3 LDAP on Windows does not work
|
||||
|
||||
A simple curl command line getting "ldap://ldap.forumsys.com" returns an
|
||||
error that says "no memory" !
|
||||
|
||||
https://github.com/curl/curl/issues/4261
|
||||
|
||||
12.4 LDAPS requests to ActiveDirectory server hang
|
||||
|
||||
https://github.com/curl/curl/issues/9580
|
||||
|
||||
13. TCP/IP
|
||||
|
||||
13.2 Trying local ports fails on Windows
|
||||
|
||||
This makes '--local-port [range]' to not work since curl cannot properly
|
||||
detect if a port is already in use, so it tries the first port, uses that and
|
||||
then subsequently fails anyway if that was actually in use.
|
||||
|
||||
https://github.com/curl/curl/issues/8112
|
||||
|
||||
15. CMake
|
||||
|
||||
15.1 cmake outputs: no version information available
|
||||
|
||||
Something in the SONAME generation seems to be wrong in the cmake build.
|
||||
|
||||
https://github.com/curl/curl/issues/11158
|
||||
|
||||
15.6 uses -lpthread instead of Threads::Threads
|
||||
|
||||
See https://github.com/curl/curl/issues/6166
|
||||
|
||||
15.7 generated .pc file contains strange entries
|
||||
|
||||
The Libs.private field of the generated .pc file contains -lgcc -lgcc_s -lc
|
||||
-lgcc -lgcc_s
|
||||
|
||||
See https://github.com/curl/curl/issues/6167
|
||||
|
||||
15.13 CMake build with MIT Kerberos does not work
|
||||
|
||||
Minimum CMake version was bumped in curl 7.71.0 (#5358) Since CMake 3.2
|
||||
try_compile started respecting the CMAKE_EXE_FLAGS. The code dealing with
|
||||
MIT Kerberos detection sets few variables to potentially weird mix of space,
|
||||
and ;-separated flags. It had to blow up at some point. All the CMake checks
|
||||
that involve compilation are doomed from that point, the configured tree
|
||||
cannot be built.
|
||||
|
||||
https://github.com/curl/curl/issues/6904
|
||||
|
||||
16. aws-sigv4
|
||||
|
||||
16.2 aws-sigv4 does not handle multipart/form-data correctly
|
||||
|
||||
https://github.com/curl/curl/issues/13351
|
||||
|
||||
17. HTTP/2
|
||||
|
||||
17.1 HTTP/2 prior knowledge over proxy
|
||||
|
||||
https://github.com/curl/curl/issues/12641
|
||||
|
||||
17.2 HTTP/2 frames while in the connection pool kill reuse
|
||||
|
||||
If the server sends HTTP/2 frames (like for example an HTTP/2 PING frame) to
|
||||
curl while the connection is held in curl's connection pool, the socket is
|
||||
found readable when considered for reuse and that makes curl think it is dead
|
||||
and then it is closed and a new connection gets created instead.
|
||||
|
||||
This is *best* fixed by adding monitoring to connections while they are kept
|
||||
in the pool so that pings can be responded to appropriately.
|
||||
|
||||
17.3 ENHANCE_YOUR_CALM causes infinite retries
|
||||
|
||||
Infinite retries with 2 parallel requests on one connection receiving GOAWAY
|
||||
with ENHANCE_YOUR_CALM error code.
|
||||
|
||||
See https://github.com/curl/curl/issues/5119
|
||||
|
||||
17.4 HTTP/2 + TLS spends a lot of time in recv
|
||||
|
||||
It has been observed that by making the speed limit less accurate we could
|
||||
improve this performance. (by reverting
|
||||
https://github.com/curl/curl/commit/db5c9f4f9e0779b49624752b135281a0717b277b)
|
||||
Can we find a golden middle ground?
|
||||
|
||||
See https://curl.se/mail/lib-2024-05/0026.html and
|
||||
https://github.com/curl/curl/issues/13416
|
||||
|
||||
18. HTTP/3
|
||||
|
||||
18.1 connection migration does not work
|
||||
|
||||
https://github.com/curl/curl/issues/7695
|
||||
|
||||
18.2 quiche: QUIC connection is draining
|
||||
|
||||
The transfer ends with error "QUIC connection is draining".
|
||||
|
||||
https://github.com/curl/curl/issues/12037
|
||||
|
||||
19. RTSP
|
||||
|
||||
19.1 Some methods do not support response bodies
|
||||
|
||||
The RTSP implementation is written to assume that a number of RTSP methods
|
||||
always get responses without bodies, even though there seems to be no
|
||||
indication in the RFC that this is always the case.
|
||||
|
||||
https://github.com/curl/curl/issues/12414
|
||||
@@ -1,258 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
SPDX-License-Identifier: curl
|
||||
-->
|
||||
|
||||
# Mail etiquette
|
||||
|
||||
## About the lists
|
||||
|
||||
### Mailing Lists
|
||||
|
||||
The mailing lists we have are all listed and described on the [curl
|
||||
website](https://curl.se/mail/).
|
||||
|
||||
Each mailing list is targeted to a specific set of users and subjects, please
|
||||
use the one or the ones that suit you the most.
|
||||
|
||||
Each mailing list has hundreds up to thousands of readers, meaning that each
|
||||
mail sent is received and read by a large number of people. People from
|
||||
various cultures, regions, religions and continents.
|
||||
|
||||
### Netiquette
|
||||
|
||||
Netiquette is a common term for how to behave on the Internet. Of course, in
|
||||
each particular group and subculture there are differences in what is
|
||||
acceptable and what is considered good manners.
|
||||
|
||||
This document outlines what we in the curl project consider to be good
|
||||
etiquette, and primarily this focus on how to behave on and how to use our
|
||||
mailing lists.
|
||||
|
||||
### Do Not Mail a Single Individual
|
||||
|
||||
Many people send one question to one person. One person gets many mails, and
|
||||
there is only one person who can give you a reply. The question may be
|
||||
something that other people would also like to ask. These other people have no
|
||||
way to read the reply, but to ask the one person the question. The one person
|
||||
consequently gets overloaded with mail.
|
||||
|
||||
If you really want to contact an individual and perhaps pay for his or her
|
||||
services, by all means go ahead, but if it is just another curl question, take
|
||||
it to a suitable list instead.
|
||||
|
||||
### Subscription Required
|
||||
|
||||
All curl mailing lists require that you are subscribed to allow a mail to go
|
||||
through to all the subscribers.
|
||||
|
||||
If you post without being subscribed (or from a different mail address than
|
||||
the one you are subscribed with), your mail is simply silently discarded. You
|
||||
have to subscribe first, then post.
|
||||
|
||||
The reason for this unfortunate and strict subscription policy is of course to
|
||||
stop spam from pestering the lists.
|
||||
|
||||
### Moderation of new posters
|
||||
|
||||
Several of the curl mailing lists automatically make all posts from new
|
||||
subscribers be moderated. After you have subscribed and sent your first mail
|
||||
to a list, that mail is not let through to the list until a mailing list
|
||||
administrator has verified that it is OK and permits it to get posted.
|
||||
|
||||
Once a first post has been made that proves the sender is actually talking
|
||||
about curl-related subjects, the moderation "flag" is switched off and future
|
||||
posts go through without being moderated.
|
||||
|
||||
The reason for this moderation policy is that we do suffer from spammers who
|
||||
actually subscribe and send spam to our lists.
|
||||
|
||||
### Handling trolls and spam
|
||||
|
||||
Despite our good intentions and hard work to keep spam off the lists and to
|
||||
maintain a friendly and positive atmosphere, there are times when spam and or
|
||||
trolls get through.
|
||||
|
||||
Troll - "someone who posts inflammatory, extraneous, or off-topic messages in
|
||||
an online community"
|
||||
|
||||
Spam - "use of electronic messaging systems to send unsolicited bulk messages"
|
||||
|
||||
No matter what, we NEVER EVER respond to trolls or spammers on the list. If
|
||||
you believe the list admin should do something in particular, contact them
|
||||
off-list. The subject is taken care of as much as possible to prevent repeated
|
||||
offenses, but responding on the list to such messages never leads to anything
|
||||
good and only puts the light even more on the offender: which was the entire
|
||||
purpose of it getting sent to the list in the first place.
|
||||
|
||||
Do not feed the trolls.
|
||||
|
||||
### How to unsubscribe
|
||||
|
||||
You can unsubscribe the same way you subscribed in the first place. You go to
|
||||
the page for the particular mailing list you are subscribed to and you enter
|
||||
your email address and password and press the unsubscribe button.
|
||||
|
||||
Also, the instructions to unsubscribe are included in the headers of every
|
||||
mail that is sent out to all curl related mailing lists and there is a footer
|
||||
in each mail that links to the "admin" page on which you can unsubscribe and
|
||||
change other options.
|
||||
|
||||
You NEVER EVER email the mailing list requesting someone else to take you off
|
||||
the list.
|
||||
|
||||
### I posted, now what?
|
||||
|
||||
If you are not subscribed with the same email address that you used to send
|
||||
the email, your post is silently discarded.
|
||||
|
||||
If you posted for the first time to the mailing list, you first need to wait
|
||||
for an administrator to allow your email to go through (moderated). This
|
||||
normally happens quickly but in case we are asleep, you may have to wait a few
|
||||
hours.
|
||||
|
||||
Once your email goes through it is sent out to several hundred or even
|
||||
thousands of recipients. Your email may cover an area that not that many
|
||||
people know about or are interested in. Or possibly the person who knows about
|
||||
it is on vacation or under a heavy work load right now. You may have to wait
|
||||
for a response and you should not expect to get a response at all. Ideally,
|
||||
you get an answer within a couple of days.
|
||||
|
||||
You do yourself and all of us a service when you include as many details as
|
||||
possible already in your first email. Mention your operating system and
|
||||
environment. Tell us which curl version you are using and tell us what you
|
||||
did, what happened and what you expected would happen. Preferably, show us
|
||||
what you did with details enough to allow others to help point out the problem
|
||||
or repeat the steps in their locations.
|
||||
|
||||
Failing to include details only delays responses and make people respond and
|
||||
ask for more details and you have to send follow-up emails that include them.
|
||||
|
||||
Expect the responses to primarily help YOU debug the issue, or ask YOU
|
||||
questions that can lead you or others towards a solution or explanation to
|
||||
whatever you experience.
|
||||
|
||||
If you are a repeat offender to the guidelines outlined in this document,
|
||||
chances are that people ignore you and your chances to get responses in the
|
||||
future greatly diminish.
|
||||
|
||||
### Your emails are public
|
||||
|
||||
Your email, its contents and all its headers and the details in those headers
|
||||
are received by every subscriber of the mailing list that you send your email
|
||||
to.
|
||||
|
||||
Your email as sent to a curl mailing list ends up in mail archives, on the
|
||||
curl website and elsewhere, for others to see and read. Today and in the
|
||||
future. In addition to the archives, the mail is sent out to thousands of
|
||||
individuals. There is no way to undo a sent email.
|
||||
|
||||
When sending emails to a curl mailing list, do not include sensitive
|
||||
information such as usernames and passwords; use fake ones, temporary ones or
|
||||
just remove them completely from the mail. Note that this includes base64
|
||||
encoded HTTP Basic auth headers.
|
||||
|
||||
This public nature of the curl mailing lists makes automatically inserted mail
|
||||
footers about mails being "private" or "only meant for the recipient" or
|
||||
similar even more silly than usual. Because they are absolutely not private
|
||||
when sent to a public mailing list.
|
||||
|
||||
## Sending mail
|
||||
|
||||
### Reply or New Mail
|
||||
|
||||
Please do not reply to an existing message as a short-cut to post a message to
|
||||
the lists.
|
||||
|
||||
Many mail programs and web archivers use information within mails to keep them
|
||||
together as "threads", as collections of posts that discuss a certain subject.
|
||||
If you do not intend to reply on the same or similar subject, do not just hit
|
||||
reply on an existing mail and change the subject, create a new mail.
|
||||
|
||||
### Reply to the List
|
||||
|
||||
When replying to a message from the list, make sure that you do "group reply"
|
||||
or "reply to all", and not just reply to the author of the single mail you
|
||||
reply to.
|
||||
|
||||
We are actively discouraging replying to the single person by setting the
|
||||
correct field in outgoing mails back asking for replies to get sent to the
|
||||
mailing list address, making it harder for people to reply to the author only
|
||||
by mistake.
|
||||
|
||||
### Use a Sensible Subject
|
||||
|
||||
Please use a subject of the mail that makes sense and that is related to the
|
||||
contents of your mail. It makes it a lot easier to find your mail afterwards
|
||||
and it makes it easier to track mail threads and topics.
|
||||
|
||||
### Do Not Top-Post
|
||||
|
||||
If you reply to a message, do not use top-posting. Top-posting is when you
|
||||
write the new text at the top of a mail and you insert the previous quoted
|
||||
mail conversation below. It forces users to read the mail in a backwards order
|
||||
to properly understand it.
|
||||
|
||||
This is why top posting is so bad (in top posting order):
|
||||
|
||||
A: Because it messes up the order in which people normally read text.
|
||||
Q: Why is top-posting such a bad thing?
|
||||
A: Top-posting.
|
||||
Q: What is the most annoying thing in email?
|
||||
|
||||
Apart from the screwed up read order (especially when mixed together in a
|
||||
thread when someone responds using the mandated bottom-posting style), it also
|
||||
makes it impossible to quote only parts of the original mail.
|
||||
|
||||
When you reply to a mail. You let the mail client insert the previous mail
|
||||
quoted. Then you put the cursor on the first line of the mail and you move
|
||||
down through the mail, deleting all parts of the quotes that do not add
|
||||
context for your comments. When you want to add a comment you do so, inline,
|
||||
right after the quotes that relate to your comment. Then you continue
|
||||
downwards again.
|
||||
|
||||
When most of the quotes have been removed and you have added your own words,
|
||||
you are done.
|
||||
|
||||
### HTML is not for mails
|
||||
|
||||
Please switch off those HTML encoded messages. You can mail all those funny
|
||||
mails to your friends. We speak plain text mails.
|
||||
|
||||
### Quoting
|
||||
|
||||
Quote as little as possible. Just enough to provide the context you cannot
|
||||
eave out. A lengthy description can be found
|
||||
[here](https://www.netmeister.org/news/learn2quote.html).
|
||||
|
||||
### Digest
|
||||
|
||||
We allow subscribers to subscribe to the "digest" version of the mailing
|
||||
lists. A digest is a collection of mails lumped together in one single mail.
|
||||
|
||||
Should you decide to reply to a mail sent out as a digest, there are two
|
||||
things you MUST consider if you really, really cannot subscribe normally
|
||||
instead:
|
||||
|
||||
Cut off all mails and chatter that is not related to the mail you want to
|
||||
reply to.
|
||||
|
||||
Change the subject name to something sensible and related to the subject,
|
||||
preferably even the actual subject of the single mail you wanted to reply to
|
||||
|
||||
### Please Tell Us How You Solved The Problem
|
||||
|
||||
Many people mail questions to the list, people spend some of their time and
|
||||
make an effort in providing good answers to these questions.
|
||||
|
||||
If you are the one who asks, please consider responding once more in case one
|
||||
of the hints was what solved your problems. The guys who write answers feel
|
||||
good to know that they provided a good answer and that you fixed the problem.
|
||||
Far too often, the person who asked the question is never heard from again,
|
||||
and we never get to know if they are gone because the problem was solved or
|
||||
perhaps because the problem was unsolvable.
|
||||
|
||||
Getting the solution posted also helps other users that experience the same
|
||||
problem(s). They get to see (possibly in the web archives) that the suggested
|
||||
fixes actually have helped at least one person.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user