Coder Social home page Coder Social logo

https-request's Introduction

๐ŸŒ https-request

This is a simple tool written in modern C++. It makes HTTP/S requests to a given host and prints the output.

Ubuntu MacOS Windows

  • The goal of this project is to experiment with HTTP clients and OpenSSL. It is not a full-featured HTTP client. For a complete production-grade HTTP client library in C++, check out express-client.
  • If you find this project informative or useful, please โญ๏ธ this repository to show your support.

Features

  • A command-line application
  • Supports both HTTP and HTTPS protocols
  • Written in modern C++
  • Cross-platform

HTTPS and certificate verification

Every operating system provides a list of trusted Certificate Authorities (CAs) that can be used to verify server certificates. However, there is no general way to import these lists.

Mozilla maintains its own trusted certificate authority (CA) store, which is frequently used by HTTP clients. curl has developed tools to extract these certificates from Firefox and convert them to a file containing the CAs' digital signatures suitable for server certificate verification. This file can be downloaded directly from their servers at https://curl.se/docs/caextract.html.

The https-request executable requires a trusted CAs PEM file named ca-bundle.crt to be placed in the same directory. This project includes a CMake option called FETCH_TRUSTED_CA (enabled by default) that downloads the Mozilla CA store into the build's binary directory. If you prefer to use a different store, turn off this option and place your own ca-bundle.crt file along with the https-request executable.

Build

The steps below have been tested on Linux, MacOS, and Windows:

1. Install dependencies

Please make sure that the following dependencies are installed on your system:

  • CMake (minimum version 3.22)
  • OpenSSL

2. Clone the repository

$ git clone https://github.com/shlomnissan/https-request.git

3. Generate build files for your environment

$ cd https-request
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Debug

To generate a build for the Release version, specify -DCMAKE_BUILD_TYPE=Release instead.

4. Build the tool

cmake --build .

Alternatively, you can build the project using your default build system directly.

Usage

This command-line application accepts a single argument: the hostname of the website to which you want to connect. Only the HTTP and HTTPS URL schemes are supported.

$ https-request https://www.betamark.com 

Licence

    ____       __                             __  
   / __ )___  / /_____ _____ ___  ____ ______/ /__
  / __  / _ \/ __/ __ `/ __ `__ \/ __ `/ ___/ //_/
 / /_/ /  __/ /_/ /_/ / / / / / / /_/ / /  / ,<   
/_____/\___/\__/\__,_/_/ /_/ /_/\__,_/_/  /_/|_|  
                                                  
Copyright (c) 2023-present Shlomi Nissan
https://betamark.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

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. 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.

https-request's People

Contributors

shlomnissan avatar

Stargazers

Felix Wang avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.