Giter VIP home page Giter VIP logo

Comments (2)

keepassium avatar keepassium commented on June 21, 2024

Huh, this is a reincarnation of #295

from keepassium.

keepassium avatar keepassium commented on June 21, 2024

As mentioned above, the issue is caused by TLS (transport layer security) session caching in system's code. All the TLS stuff is abstracted away deep in the system code and there is no way for an app to flush or disable that cache.

As a solution, Apple suggests to create a separate URLSession instance for each connection. Considering that each URLSession maintains its own TLS session cache, independent sessions would avoid caching problem.

Unfortunately, this solution does not seem to work. Even when KeePassium uses a different URLSession for each URL, it receives correct responses for both files only the first time. After that, one of the responses returns status 404.

Interestingly, the behavior differs among the tested WebDAV services. Synology WebDAV server and koofr.eu work normally, returning different files for different users, even if using the same shared URLSession for all connections. In contrast, woelkli.com ends up with the error even if using separate connections. Apparently, server-side caching is also involved in some cases.

The only sure-fire solution I see would be to replace URLSession with some custom OpenSSL-based implementation. This is complicated and can be justified only for networking-focused apps like file managers and browsers. For a password manager, however, this is way too much trouble for solving such a narrow-niche issue.

This leaves us with the following workarounds offered by Apple in the linked article:

  • Consider configuring your server to listen on different ports. Then use a different port number for each connection. (Port number is part of the TLS caching key.)
  • If you have control over server's DNS, configure different connections to go to different subdomains, e.g. alice.example.com and bob.example.com.
  • Append a dot (.) to the host name of the second connection, e.g. example.com/file and example.com./file. This ends up as a different caching key, too. This is the only method that does not require control over server configuration, but it is limited to two connections only (we cannot add a chain of dots).

See also:

from keepassium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.