profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/amesgen/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

amesgen/http-client-websockets 3

Glue code for http-client and websockets

amesgen/ghcup-pkgbuild 2

PKGBUILD for ghcup, a Haskell toolchain installer

amesgen/hellsmack 2

Minecraft stuff

amesgen/dhall-recursive-adt 1

Convert recursive ADTs between Dhall and Haskell

amesgen/actions 0

Github actions for Haskell CI

amesgen/async-tungstenite 0

Async binding for Tungstenite, the Lightweight stream-based WebSocket implementation

amesgen/case-insensitive 0

A case-insensitive string for Scala

amesgen/cats-effect 0

The purely functional runtime system for Scala

amesgen/clap 0

A full featured, fast Command Line Argument Parser for Rust

amesgen/cryptonite 0

lowlevel set of cryptographic primitives for haskell

release http4s/http4s-jdk-http-client

v0.6.0-M3

released time in a day

created taghttp4s/http4s-jdk-http-client

tagv0.6.0-M3

JDK 11+ http client implementation for http4s clients

created time in a day

created tagamesgen/http4s-jdk-http-client

tagv0.6.0-M3

JDK 11+ http client implementation for http4s clients

created time in a day

delete branch amesgen/http4s-jdk-http-client

delete branch : changelog-v0.6.0-M3

delete time in a day

push eventhttp4s/http4s-jdk-http-client

amesgen

commit sha c7adefbb0cdb5f8806467c630e1c3b6ea488895a

Update changelog vor v0.6.0-M3 (#496)

view details

push time in a day

create barnchamesgen/http4s-jdk-http-client

branch : changelog-v0.6.0-M3

created branch time in a day

issue closedhttp4s/http4s-jdk-http-client

"java.io.IOException: HTTP/1.1 header parser received no bytes" over HTTPS Proxy

Hi, I encounter java.io.IOException: HTTP/1.1 header parser received no bytes when making an API call through an authenticated HTTPS proxy.

This is how I instantiated the client.

Resource
        .eval(F.delay {
          val proxyHost = config.proxyHost
          val proxyPort = 8443
          HttpClient
            .newBuilder()
            .version(HttpClient.Version.HTTP_1_1)
            .sslContext(buildSSLContext())
            .proxy(ProxySelector.of(new InetSocketAddress(proxyHost, proxyPort)))
            .build()
        })
        .flatMap(JdkHttpClient(_))

private def buildSSLContext(): SSLContext = {
    val keyStore = KeyStore.getInstance(KeyStore.getDefaultType())
    keyStore.load(null)

    val certFileStream = this.getClass.getResourceAsStream("/path/to/cert.pem")
    val certificate    = CertificateFactory.getInstance("X.509").generateCertificate(certFileStream)
    keyStore.setCertificateEntry("cert", certificate);

    val tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm())
    tmf.init(keyStore)
    val trustManagers = tmf.getTrustManagers()

    val sslContext = SSLContext.getInstance("TLS")
    sslContext.init(null, trustManagers, null)
    sslContext
  }

I have also tried removing TLS1.3 by following the this approach but to no avail.

This is largely how I set the header and make the API call

Uri.fromString(url).liftTo[F].flatMap { uri =>
            val reqEntity =
                    MyRequest(
                        ... (omitted)
                    )

            val requestHeaders = {
                    val proxyCredentials = BasicCredentials(
                        config.proxyUsername,
                        config.proxyPassword
                    )
                    Headers(
                        Header.Raw(ci"Proxy-Authorization", s"Basic ${proxyCredentials.token}"),
                        Header.Raw(ci"X-API-key", config.apiKey),
                    )
                }

            val request = Request[F](
                method = Method.POST,
                uri = uri,
                headers = requestHeaders
            )
            .withEntity(reqEntity)

            client.run(request).use { response =>
                ...
            }
            .recoverWith {
                case e =>
                    for {
                        _ <- Logger[F].error(s"Error when calling API: $e: ${e.getMessage}") // the exception is logged here
                        err <- Exception.APICallError.raise[F, MyResponse] // throw my custom exception
                    } yield err
            }
        }

Any help would be appreciated!

closed time in a day

sushengloong

issue commenthttp4s/http4s-jdk-http-client

"java.io.IOException: HTTP/1.1 header parser received no bytes" over HTTPS Proxy

  • Trying to reproduce the issue with another HTTP client (e.g. via another http4s backend with proxy support).
  • Maybe the proxy is misbehaving?
  • An universal reason for these kinds of things could be random network failures.

Either way, for now, it does not seem that this issue is related to http4s-jdk-http-client, so I am closing it. But feel free to post an update here if you find a solution!

sushengloong

comment created time in a day

push eventhttp4s/http4s-jdk-http-client

Scala Steward

commit sha 08ea989c56b99c9d668071ba147f0ac4cbfb115e

Update sbt-mdoc to 2.2.22 (#466)

view details

Scala Steward

commit sha 0956d40305f0ad0d4a0b50226cdb97a8ccd448d3

Update fs2-core, fs2-reactive-streams to 3.1.1 (#479)

view details

Scala Steward

commit sha 51647ba58807c19485a8026488cd70e82ce401f2

Update sbt-mdoc to 2.2.23 (#480)

view details

Scala Steward

commit sha 57545c71653cea1eebfdb8316b4b5efc8ab424f5

Update scalafmt-core to 3.0.1 (#481)

view details

Scala Steward

commit sha 382d2d7f2925d10b76bd50a08fc9697dc92cfccb

Update cats-effect, cats-effect-kernel, ... to 3.2.4 (#482)

view details

Scala Steward

commit sha 33acf71b2ec53c19056a28a63f3f7a0975582f6a

Update cats-effect, cats-effect-kernel, ... to 3.2.5 (#483)

view details

Scala Steward

commit sha 478c1f46398d5812061dab022d95e682e41b4b3f

Update munit to 0.7.29 (#484)

view details

Scala Steward

commit sha 1be20d8bbbbea1c4d8343729cbfadc19853ef2c6

Update scodec-bits to 1.1.28 (#485)

view details

Scala Steward

commit sha 19c4133ccd1fcd3467c5f3450601c7f9a967939e

Update scalafmt-core to 3.0.2 (#488)

view details

Scala Steward

commit sha 1c4d81f081e741a14d108ee37ce2c374fa5b405b

Update cats-effect, cats-effect-kernel, ... to 3.2.7 (#489)

view details

Scala Steward

commit sha 1b3592e58a6ef3a1f72a3d7350082d4605e3cd23

Update cats-effect, cats-effect-kernel, ... to 3.2.8 (#490)

view details

Scala Steward

commit sha 69d5491c2ec70a2c59de71f3ad28824d72158e12

Update scala3-library to 3.0.2 (#486) Co-authored-by: amesgen <amesgen@amesgen.de>

view details

Scala Steward

commit sha ae27e06dd43b80c310f0b8cee9758de4a352d34c

Update scalafmt-core to 3.0.3 (#491)

view details

Scala Steward

commit sha f53722b01b21155df8ae14697df6521c2a4d251d

Update fs2-core, fs2-reactive-streams to 3.1.2 (#492)

view details

amesgen

commit sha aa7ada29e1057bcd91363230cd5698086fa0124c

Use local echo server in the docs (#495) echo.websocket.org is no longer available

view details

push time in a day

delete branch amesgen/http4s-jdk-http-client

delete branch : local-echo-server

delete time in a day

push eventhttp4s/http4s-jdk-http-client

amesgen

commit sha 8a9e6b831b92779df326c588a4b660499ef08b73

Use local echo server in the docs (#495) echo.websocket.org is no longer available

view details

push time in a day

PR merged http4s/http4s-jdk-http-client

Use local echo server in the docs

echo.websocket.org is no longer available

+48 -28

0 comment

2 changed files

amesgen

pr closed time in a day

PR opened http4s/http4s-jdk-http-client

Use local echo server in the docs

echo.websocket.org is no longer available

+48 -28

0 comment

2 changed files

pr created time in a day

create barnchamesgen/http4s-jdk-http-client

branch : local-echo-server

created branch time in a day

issue commenttweag/ormolu

Extract stack.yaml from README.md

Good idea, I created #777 for this. Additionally, I published ormolu-bin to the AUR which uses the official release binaries instead of building ormolu from scratch.

hseg

comment created time in a day

PR opened tweag/ormolu

Add stack.yaml

Closes #776

+7 -10

0 comment

3 changed files

pr created time in a day

create barnchtweag/ormolu

branch : amesgen/stack.yaml

created branch time in a day

push eventtweag/ormolu

amesgen

commit sha b71d30bb1eb08c875a060a75af47c568ab8abcb1

Remove stack.yaml from README

view details

push time in a day

create barnchtweag/ormolu

branch : amesgen/stack.yaml

created branch time in a day

issue openedinput-output-hk/haskell.nix

macOS binaries are not self-contained

When running a binary produced by haskell.nix for macOS on a machine without nix, it fails with

dyld: Library not loaded: /nix/store/zyh3yfv4npb5vyhqmp6hswfps0j7smyn-libffi-3.3/lib/libffi.7.dylib

For ormolu, we build binaries on GitHub Actions CI via haskell.nix (using this config). The musl64 linux and cross-compiled Windows binaries work perfectly well. But for the macOS binary, we get:

 $ wget -q https://github.com/tweag/ormolu/releases/download/0.3.0.0/ormolu-macOS.zip
 $ 7z e ormolu-macOS.zip
 $ otool -L ormolu
ormolu:
	/nix/store/qgygs5g9l0zxhs8fzjjqpmmlzps1hlrd-libiconv-50/lib/libiconv.dylib (compatibility version 7.0.0, current version 7.0.0)
	/nix/store/wkgrylws6qa3iajc2py42m5fhyxnwkjv-gmp-6.2.1/lib/libgmp.10.dylib (compatibility version 15.0.0, current version 15.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
	/nix/store/zyh3yfv4npb5vyhqmp6hswfps0j7smyn-libffi-3.3/lib/libffi.7.dylib (compatibility version 9.0.0, current version 9.0.0)
 $ ./ormolu --version
dyld: Library not loaded: /nix/store/zyh3yfv4npb5vyhqmp6hswfps0j7smyn-libffi-3.3/lib/libffi.7.dylib
  Referenced from: /Users/runner/work/stuff/stuff/./ormolu
  Reason: image not found

Is there a way to make the output independent from libraries in /nix?

created time in a day

push eventamesgen/stuff

amesgen

commit sha 28da4588c2e424a0c01b7c1bdc41082401ddd750

Test ormolu on macOS

view details

push time in a day

issue commenthttp4s/http4s-jdk-http-client

"java.io.IOException: HTTP/1.1 header parser received no bytes" over HTTPS Proxy

Can you try to reproduce the issue without http4s-jdk-http-client, but only with java.net.http.HttpClient?

sushengloong

comment created time in a day

push eventamesgen/stuff

amesgen

commit sha e9dfa0cbe4c551ff9bfe63b469045278b4af52ae

Test ormolu on macOS

view details

push time in a day

push eventamesgen/stuff

amesgen

commit sha 449ff3eda942c4e62b78297445d58cf455b13166

Test ormolu on macOS

view details

push time in a day

create barnchamesgen/stuff

branch : macos-test

created branch time in a day

fork amesgen/ormolu-action

Ormolu GitHub action

fork in 2 days

issue commentkowainik/policeman

`cabal install policeman` fails using cabal version 3.6

I also stumbled upon this issue with cabal 3.6, and FTR, another workaround when using the Paths_ module for the version number is to use the CPP variable CURRENT_PACKAGE_VERSION which has been available since cabal 2.0: https://cabal.readthedocs.io/en/3.6/cabal-package.html?highlight=CURRENT_PACKAGE_VERSION#conditional-compilation

jneira

comment created time in 2 days

issue commenttweag/ormolu

parse errors with CPP

Yeah, on CI, we test formatting of e.g. graphql-engine, but we remove CPP:

https://github.com/tweag/ormolu/blob/06b767c8b70e60321a4debc4599127446f958e5b/nix/ormolize/default.nix#L26

I created #775 to feature this issue more prominently in the changelog.

robx

comment created time in 2 days