go-mc icon indicating copy to clipboard operation
go-mc copied to clipboard

add KeyManager in server for better client join performance

Open cs8425 opened this issue 2 years ago • 0 comments

As mentioned in #209 , I add KeyManager for caching RSA keypair, not yet add the option for prevent-proxy-connections: true right now.

As mentioned in #210 ,

(By simply store the server's key in the LoginHandler. There is no need to use interface if we have only one implementation.

Add a interface is for user who need more control without re-implement full MojangLoginHandler, eg:

  1. can automatically generate keypair for N hours (1024 bit RSA is weak)
  2. use specific key for specific client if they need

Otherwise we may need to add GenerateKey(), SetKey(), GetKey() on the MojangLoginHandler and lost the ability for use specific key for specific client.

BTW. I test vanilla 1.19 client, it can handle up to 8192 bit key without issue. (join will be slower) (more bits are not test)

cs8425 avatar Jul 21 '22 06:07 cs8425