# Akka GRPC unsupported method PRI

**URL:** https://discuss.akka.io/t/akka-grpc-unsupported-method-pri/4269
**Category:** Akka gRPC
**Created:** [May 24, 2019, 5:28pm UTC](https://discuss.akka.io/t/akka-grpc-unsupported-method-pri/4269 "2019-05-24T17:28:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![yanick.salzmann](https://avatars.discourse-cdn.com/v4/letter/y/ccd318/32.png) [@yanick.salzmann](https://discuss.akka.io/u/yanick.salzmann)
#### Post date: [May 24, 2019, 5:28pm UTC](https://discuss.akka.io/t/akka-grpc-unsupported-method-pri/4269/1 "2019-05-24T17:28:35Z")

</div>

Hello all

I have been working myself through the tutorial about akka-grpc and sadly nothing has worked so far. First I had decided to set up my akka-http server with http only and no https but with `UseHttp2.always()`. No matter what I tried with `grpcurl` I could not get anything to work (the command `grpcurl -plaintext localhost:9999 list`.

Everytime I tried it, I got the error that `Illegal request, responding with status '501 Not Implemented': Unsupported HTTP method: PRI`.

I then assumed I just have to bite the bullet and move to HTTPS. After many struggles I managed to get the handshake error gone so I could use `grpcurl -insecure localhost:9999 list` only to be greeted with…

`Illegal request, responding with status '501 Not Implemented': Unsupported HTTP method: PRI`.

I really dont know what else I could do. My application.conf enables http2 support for akk:  
`akka.http.server.preview.enable-http2 = on`

My connection definition enforces http2:

```auto
        return ConnectHttp.toHostHttps(netInterface, port, UseHttp2.always())
                .withCustomHttpsContext(context);

```

It is really a pain to figure out what is going because there are literally 0 logs except that annoying “501 Not Implemented” message…

I also have:

```auto
		<dependency>
			<groupId>com.typesafe.akka</groupId>
			<artifactId>akka-http2-support_${scala.binary.version}</artifactId>
		</dependency>

```

What am I missing?

BR  
Yanick

---

<div class="post-metadata">

### Author: ![yanick.salzmann](https://avatars.discourse-cdn.com/v4/letter/y/ccd318/32.png) [@yanick.salzmann](https://discuss.akka.io/u/yanick.salzmann)
#### Post date: [May 26, 2019, 9:54am UTC](https://discuss.akka.io/t/akka-grpc-unsupported-method-pri/4269/2 "2019-05-26T09:54:45Z")

</div>

Additional information from curl:

```auto
curl -k -v https://localhost:9999 
* Rebuilt URL to: https://localhost:9999/ 
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9999 (#0)
* ALPN, offering h2 
* ALPN, offering http/1.1
* successfully set certificate verify locations: 
* CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2): 
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20): 
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol

```

As you can see it says `ALPN, offering h2` and then `ALPN, server did not agree to a protocol`

---

<div class="post-metadata">

### Author: ![yanick.salzmann](https://avatars.discourse-cdn.com/v4/letter/y/ccd318/32.png) [@yanick.salzmann](https://discuss.akka.io/u/yanick.salzmann)
#### Post date: [May 26, 2019, 10:17am UTC](https://discuss.akka.io/t/akka-grpc-unsupported-method-pri/4269/3 "2019-05-26T10:17:20Z")

</div>

Figured out my problem. I was using:

`Http.get(actorSystem).bind(...)` and then on each incoming connection `connection.handleAsync`. It seems that this is not equivalent to `Http.get(actorSystem).bindAndHandleAsync`. I will check with akka http if this is intended.

---

<div class="post-metadata">

### Author: ![raboof](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/raboof/32/2913_2.png) [@raboof](https://discuss.akka.io/u/raboof)
#### Post date: [July 18, 2019, 7:02am UTC](https://discuss.akka.io/t/akka-grpc-unsupported-method-pri/4269/4 "2019-07-18T07:02:28Z")

</div>

> [@yanick.salzmann](#):
>
> I will check with akka http if this is intended.

This is not ‘intended’ per se, but it’s a known limitation that Akka HTTP HTTP/2 support currently only works with `bindAndHandleAsync` ([Server-Side HTTP/2 • Akka HTTP](https://doc.akka.io/docs/akka-http/current/server-side/http2.html#use-bindandhandleasync-and-https)).

---

<div class="post-metadata">

### Author: ![raboof](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/raboof/32/2913_2.png) [@raboof](https://discuss.akka.io/u/raboof)
#### Post date: [July 29, 2021, 9:08am UTC](https://discuss.akka.io/t/akka-grpc-unsupported-method-pri/4269/5 "2021-07-29T09:08:26Z")

</div>

The new [`newServerAt().bind()` API](https://doc.akka.io/api/akka-http/10.2.5/akka/http/scaladsl/ServerBuilder.html#bind(f:akka.http.scaladsl.model.HttpRequest=%3Escala.concurrent.Future%5Bakka.http.scaladsl.model.HttpResponse%5D):scala.concurrent.Future%5Bakka.http.scaladsl.Http.ServerBinding%5D) also supports HTTP/2
