yushijinhun / authlib-injector

Build your own Minecraft authentication system.
https://authlib-injector.yushi.moe
GNU Affero General Public License v3.0
744 stars 67 forks source link

bungeecord上使用后进不去服务器 #108

Closed fulide closed 3 years ago

fulide commented 3 years ago

实际问题体现为 通过bc时一直处于"通讯加密中",随后超时,后台能看到自己connected,偶尔会出现未找到fallback server这类的提示,但online-mode=false又正常进入连接进子服。 测试环境: jdk11 bc当前最新构建,以及最新构建的waterfall也试过了 无任何插件 paper1.16.5 无任何插件 在不用bc的情况下,paper能正常使用authlib-injector,且能通过验证进入游戏

yushijinhun commented 3 years ago

最近比较忙,等我有时间我就去测试一下。

cdwcgt commented 3 years ago

我也是这个情况 所有插件关闭 spigot 1.12.2 bc是我当时最新应该是 1549 https://github.com/yushijinhun/authlib-injector/releases/tag/v1.1.34 debug后开启是这样的

>[authlib-injector] [INFO] Version: 1.1.34
[authlib-injector] [INFO] Authentication server: https://cdwcgt.top:38451/api/yggdrasil
[authlib-injector] [DEBUG] Metadata: {"meta":{"serverName":"cdwcgt's Minecraft Skin Site","implementationName":"Yggdrasil API for Blessing Skin","implementationVersion":"5.1.2","links":{"homepage":"https:\/\/cdwcgt.top:38451","register":"https:\/\/cdwcgt.top:38451\/auth\/register"},"feature.non_email_login":true},"skinDomains":["cdwcgt.top"],"signaturePublickey":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA641KJHejJq1bwHoIcAvW\namuae9Avz\/82nf59TWjQgebWI2cmMiBCdUbARbUDxgssPGkztdXDYFa0mksQYK2W\nHXfsMt4kEYYWNfx\/sPKd2vsTLanmpLc0IN7P7vgJNs4wBfZXl0p+4ZPGmT6BUU7a\nRpRkGVgta7sUCsL7VIYH1dKukmU4VGMrHdHr5Rt0bx+sDW+sVyf\/h\/Bblr7uMofT\nvrvEEI3b4ddkQXInXfuqJiYtOb0awKKWZBQZFE06x9GUTZ7QzJ+cQQ56byjwyEBq\n6YYrq4LqaJVpno2drU7kxm1sEaLSzZKpFHxD97umKpXRBQlSi\/vqTMYS2gY948mA\nwQkOr0NV5BC+KkAV6Jdx0SgM98owF0gdXhG+B6I4HgMnaGGQIFPrFCEJFs9OJrYc\ncYG6hzgmcB9YsLBrNPVLTY+eTX6whFKTzeLWYjeEmClyijK1e8fF0D3NfYb2oJK3\nujA5l1ZDmOddLZThoz9rHk4XvtX0qOllFeB1IGrM+D3KCzCbcZMkjCkuNgiQvB1X\nmPuqcWtfom2j07mwM0vI8adGKzVSwBMEMGyPoHfvmI+CqYo9UeIJCpedA+kDgNYC\npUsTM86CB\/vSqyuXPq\/kwh+F9AHCjI3UP6dirvR7DCzGmZWfmJfFrkz7+SXzKTrM\nTYcgJG4YVz+Oc5h+eo9keqECAwEAAQ==\n-----END PUBLIC KEY-----\n"}
[authlib-injector] [DEBUG] Parsed metadata: APIMetadata [apiRoot=https://cdwcgt.top:38451/api/yggdrasil/, skinDomains=[cdwcgt.top], decodedPublickey=Optional[Sun RSA public key, 4096 bits
  params: null
  modulus: 960967962843367974541800080497974113231934056271849980150412513784093683223498620392983146590505657622089908277838694797844117120073296950704025699542949337441104696029070404485917774211372934733386042936137190646193215781905140021560297482968714266827865655111677595584089768615169651695412890355779721270414849995665300544586998666896652778971615893608977691848311381554708220933647432072587612687984004432378152910314914704707353072703752104550942627196885961784985610696146100959696197086513532443496566089140756705198204435755640230745275441325637228489774916015232344767130623959475260157627107305742487065585486744840035177931620636252038485772320592346536715134748485557648598545460351063821446096310056257439850158133490442457830580951877070827944241495138918382276858500591946234998616032953371954893394886789717869732242347021137433805826128111816267079687359637264014057587418463751834868669616431986888969952573911550980682801693562488269772948926049879247725393213030150512546404474901272118403777403296463735099434534375621329551855991657168765136049874468354545561816990077017265772532809447281903920057462786327358939431188226352709863110509830733852721913189313900743689723229024447287424651296803201097303773706913
  public exponent: 65537], meta={feature.non_email_login=true, implementationName=Yggdrasil API for Blessing Skin, implementationVersion=5.1.2, links={"homepage":"https:\/\/cdwcgt.top:38451","register":"https:\/\/cdwcgt.top:38451\/auth\/register"}, serverName=cdwcgt's Minecraft Skin Site}]
*** Warning, this build is outdated ***
*** Please download a new build from http://ci.md-5.net/job/BungeeCord ***
*** You will get NO support regarding this build ***
*** Server will start in 10 seconds ***
17:41:31 [信息] Using standard Java JCE cipher.
17:41:31 [信息] Using standard Java compressor.
17:41:31 [信息] Enabled BungeeCord version git:BungeeCord-Bootstrap:1.16-R0.4-SNAPSHOT:9c078b7:1539
[authlib-injector] [INFO] Httpd is running on port 62303
[authlib-injector] [DEBUG] Transformed url [https://sessionserver.mojang.com/session/minecraft/hasJoined?username=] to [http://127.0.0.1:62303/https/sessionserver.mojang.com/session/minecraft/hasJoined?username=]
[authlib-injector] [INFO] Transformed [net.md_5.bungee.connection.InitialHandler] with [Constant URL Transformer]
..........
17:41:31 [信息] Enabled plugin cmd_send version git:cmd_send:1.16-R0.4-SNAPSHOT:9c078b7:1539 by SpigotMC
17:41:31 [信息] Enabled plugin cmd_list version git:cmd_list:1.16-R0.4-SNAPSHOT:9c078b7:1539 by SpigotMC
17:41:32 [信息] Listening on /0.0.0.0:34092
17:41:57 [信息] [/******:10072] <-> InitialHandler has connected
>[authlib-injector] [DEBUG] Reverse proxy: > GET https://cdwcgt.top:38451/api/yggdrasil/sessionserver/session/minecraft/hasJoined?username=cdwcgt&serverId=-**********, headers: {} #header完完全全就是空的
[authlib-injector] [DEBUG] Reverse proxy: < 200 OK , headers: {Strict-Transport-Security=[max-age=0; preload], Server=[Microsoft-IIS/10.0], Cache-Control=[no-cache, private], X-Authlib-Injector-API-Location=[https://cdwcgt.top:38451/api/yggdrasil], Set-Cookie=[locale=en; expires=Sat, 03-Apr-2021 11:42:49 GMT; Max-Age=7200; path=/; httponly; samesite=lax], Content-Length=[1907], Date=[Sat, 03 Apr 2021 09:42:48 GMT], X-Powered-By=[ASP.NET, PHP/7.4.9], Content-Type=[application/json]}
17:47:54 [警告] [cdwcgt,/125.77.80.227:10834] <-> InitialHandler - read timed out

然后后面什么都没有客户端显示连接超时

换了个机子测试多了一条

19:16:03 [严重] Error authenticating cdwcgt with minecraft.net io.netty.handler.timeout.ReadTimeoutException 没有Successful read, server response was 200

单独服务端(直连不通过bc)一切正常

和此issues不一样的是我使用的是minecraft 1.12.2 并且使用旧版本bungee后缓解 #1400

yushijinhun commented 3 years ago

因为太忙所以回复比较迟。

我测试了下 Bungeecord build 1565 以及 1549,完全正常。测试的子服是 Spigot 1.16.5 (build 3040) 和 Paper 1.16.5 (build 558),OpenJDK 版本是 11.0.11,验证服务器用的是 LittleSkin。

@fulide 请问你是否还能复现你的问题?如果可以的话,麻烦提供一下 Bungeecord 和 Paper 的日志。

@cdwcgt 如果换 LittleSkin 作为验证服务器是否依然有问题?

cdwcgt commented 3 years ago

用LittleSkin后没有问题

21:34:29 [信息] [cdwcgt,/192.168.0.1:5115] <-> InitialHandler has connected
>[authlib-injector] [DEBUG] Reverse proxy: > GET https://littleskin.cn/api/yggdrasil/sessionserver/session/minecraft/hasJoined?username=cdwcgt&serverId=-*******, headers: {}
[authlib-injector] [DEBUG] Reverse proxy: < 200 OK , headers: {expires=[-1], CF-RAY=[63f4baa0a906d382-LAX], Server=[cloudflare], X-Content-Type-Options=[nosniff], pragma=[no-cache], Date=[Tue, 13 Apr 2021 12:34:31 GMT], CF-Cache-Status=[DYNAMIC], Strict-Transport-Security=[max-age=31536000; includeSubDomains; preload], NEL=[{"max_age":604800,"report_to":"cf-nel"}], Cache-Control=[private, must-revalidate], X-Authlib-Injector-API-Location=[https://mcskin.littleservice.cn/api/yggdrasil], Report-To=[{"group":"cf-nel","endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=c****"}],"max_age":604800}], Set-Cookie=[locale=en; expires=Tue, 13-Apr-2021 14:34:31 GMT; Max-Age=7200; path=/; httponly; samesite=lax, __cfduid=*** expires=Thu, 13-May-21 12:34:31 GMT; path=/; domain=.littleskin.cn; HttpOnly; SameSite=Lax; Secure], Vary=[Accept-Encoding, Accept-Encoding], alt-svc=[h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400], Expect-CT=[max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"], cf-request-id=[**], Content-Type=[application/json]}
21:34:31 [信息] [cdwcgt] <-> ServerConnector [lobby] has connected
yushijinhun commented 3 years ago

前几天又遇到用户反映这个问题,但我始终无法重现。如有人找到问题原因,请麻烦在此处发一下,十分感谢!

ThreeIce commented 3 years ago

我也遇到了这个问题,也是只要用littleskin测试就没有问题了 如果方便可以用我的皮肤站测试一下 https://mc.threeice.com:8083/ 猜测一:我们的皮肤站网址带端口 猜测二:我们皮肤站uuid选择的是离线uuid

cdwcgt commented 3 years ago

那么这是我的 https://cdwcgt.top:38451/ UUID算法是ver3

ThreeIce commented 3 years ago

两个猜测都排除了,我试了红石皮肤站,也登不进去

ThreeIce commented 3 years ago

只有littleskin是好的

HySand commented 3 years ago

Paper 1.16-762 Waterfall 1.16-427 openjdk 11.0.11 authlib-injector v-1.1.35

[20:50:18 INFO]: [/58.218.234.95:5799] <-> InitialHandler has pinged [20:50:25 INFO]: [/58.218.234.95:5815] <-> InitialHandler has pinged [20:54:32 INFO]: [/58.218.234.95:6548] <-> InitialHandler has pinged [20:55:24 INFO]: [/58.218.234.95:6641] <-> InitialHandler has pinged [20:56:17 INFO]: [/58.218.234.95:6867] <-> InitialHandler has pinged [20:56:30 INFO]: [/58.218.234.95:6887] <-> InitialHandler has pinged [20:56:52 INFO]: [/58.218.234.95:6993] <-> InitialHandler has connected [20:56:57 ERROR]: Error authenticating Sannnd with minecraft.net io.netty.handler.timeout.ReadTimeoutException: null

网站不带端口,ver4,emmmm

yushijinhun commented 3 years ago

那么这是我的 https://cdwcgt.top:38451/ UUID算法是ver3

@cdwcgt 我已成功使用你提供的验证服务器重现该问题。

yushijinhun commented 3 years ago

我总觉得这是 bungeecord 用的 HttpClient 的问题...

yushijinhun commented 3 years ago

该 bug 系 authlib-injector 返回了重复的 Content-Length 头引起,影响范围为所有使用 Netty 作为 HttpClient 的服务端,表现为连接超时。将在 v1.1.37 修复。