Skip to content

NativePRNGNonBlocking is not found, fallback to SHA1PRNG #964

Closed

Description

@PinkieSwirl

Ktor Version

1.1.2, 1.1.3

Ktor Engine Used(client or server and name)

netty server

JVM Version, Operating System and Relevant Context

JRE 11, Windows 10

Feedback

I get the following warning:

io.ktor.util.random - NativePRNGNonBlocking is not found, fallback to SHA1PRNG

Is there anything I can do to fix that?

Activity

  1. PinkieSwirl commented on Mar 11, 2019

    @PinkieSwirl
    Author

    I did some research and this SecureRandom instance is simply not available on windows.

    Previous to java 9 there are only two implementations available on windows: WINDOWS-PRNG and SHA1PRNG. So a solution would either be to switch to the first for windows (but I don't know what the differences to the sha1prng are), or to check if windows is the current platform and supress/change the warning to include this problem.

    From java 9 and up all platforms also support another implementation: DRBG. Ktor could check if such an implementation is available (should be simple to add).

    What I'm currently doing is to set it my self:

    System.setProperty("io.ktor.random.secure.random.provider", "DRBG")
    Security.setProperty("securerandom.drbg.config", "HMAC_DRBG,SHA-512,256,pr_and_reseed")
    

    The first line uses the DRBG, the second line configures it (optionally).

    Since this got the problem tag I should note that for me this issue is now actually a bug and not a problem.

  2. oleg-larshin commented on Aug 10, 2020

    @oleg-larshin

    Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    uxUser Experience issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions