AHC causes uncleanShutdown error on server side.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- swift
- Ambito
- networking
Direzione di ricerca
Riproduci il report usando il server hummingbird-examples/http2 e il codice client AsyncParsableCommand run() async throws mostrato, quindi confrontalo con la richiesta curl. Traccia l'arresto del client e la gestione di TLS intorno a HTTPClient.withHTTPClient e client.shutdown(), concentrandoti sul fatto che la connessione invii o meno CLOSE_NOTIFY. Il lavoro è completato quando la richiesta può terminare e il comando può uscire senza che il server segnali uncleanShutdown.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I have a server that is functionally similar in setup to hummingbird-examples/http2, when I use async-http-client to make a request with a command line program that exits after the request, humming bird reports this error:
[HummingbirdHTTP2] Error handling inbound connection for HTTP2 handler: uncleanShutdown
I do not see the same error when using curl:
curl --cacert certs/ca.crt --http2 -v https://localhost:8043/healthcheck
var tlsConfiguration: TLSConfiguration {
get throws {
let certificateChain = try NIOSSLCertificate.fromPEMFile(self.certificateChain)
var tlsConfiguration = TLSConfiguration.makeClientConfiguration()
tlsConfiguration.trustRoots = .certificates(certificateChain)
#if os(macOS)
tlsConfiguration.certificateVerification = .none
#else
// not supported with Network.framework
tlsConfiguration.certificateVerification = .noHostnameVerification
#endif
return tlsConfiguration
}
}
relevant code in the run() async throws method of an AsyncParsableCommand:
var clientConfig = HTTPClient.Configuration()
clientConfig.tlsConfiguration = try self.tlsConfiguration
try await HTTPClient.withHTTPClient(configuration: clientConfig) { client in
var request = HTTPClientRequest(url: url.absoluteString)
request.method = .POST
request.headers.add(name: "content-type", value: "application/json")
request.headers.add(name: "content-length", value: "\(payloadData.count)")
request.body = .bytes(payloadData)
let response = try await client.execute(request, timeout: .seconds(30))
let body = try await response.body.collect(upTo: 10 * 1024 * 1024)
}
I've tried many variations that all execute await client.shutdown() before exiting and they all result in this error. From what Cory says here: https://forums.swift.org/t/niossl-spurious-uncleanshutdown-error/53031/3 it seems like AHC isn't sending CLOSE_NOTIFY on shutdown?
- Lingua principale
- Swift
- Stelle
- 1.1k
- Fork
- 156
- Merge medio
- 1h 54m
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di swift-server/async-http-client
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
-
Invalid state: idleAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
swift-server/async-http-client#927 · 2 commenti ·
-
Windows versionAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
swift-server/async-http-client#923 · 1 commento ·
-
Crash in `HTTP2ClientRequestHandler`Forse già presa @rupayon123 l’ha presa 17 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
Tutte le issue di swift-server/async-http-client
Issue simili
-
cable-report
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
darrylmorley/whatcable#656 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
omlahore/RemoveMacAI#67 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
521xueweihan/HelloGitHub#4049 ·
-
[quality] macOSScreenshotLocation(): configured-location branch (ScreenshotFiles.swift:30) never executes under swift testForse già presa @arteeh l’ha presa oggi. Apertaagent/quality agent/reviewer help wanted kind/test stage/040-covered-by-pr testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
hivecommons/hotshot#249 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
whysosuresh/capsjump#65 ·
I maintainer di solito rispondono entro 1 giorno