Stay organized with collections
Save and categorize content based on your preferences.
SSLSessionCache
class SSLSessionCache
File-based cache of established SSL sessions. When re-establishing a connection to the same server, using an SSL session cache can save some time, power, and bandwidth by skipping directly to an encrypted stream. This is a persistent cache which can span executions of the application.
Summary
Public constructors |
Create a session cache at the default location for this app.
|
Create a session cache using the specified directory.
|
Public constructors
SSLSessionCache
SSLSessionCache(context: Context!)
Create a session cache at the default location for this app. Multiple instances share data internally.
Parameters |
context |
Context!: for the application |
SSLSessionCache
SSLSessionCache(dir: File!)
Create a session cache using the specified directory. Individual session entries will be files within the directory. Multiple instances for the same directory share data internally.
Parameters |
dir |
File!: to store session files in (created if necessary) |
Exceptions |
java.io.IOException |
if the cache can't be opened |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# SSLSessionCache\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nSSLSessionCache\n===============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/SSLSessionCache \"View this page in Java\") \n\n```\nclass SSLSessionCache\n```\n\n|---|----------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.SSLSessionCache](#) |\n\nFile-based cache of established SSL sessions. When re-establishing a connection to the same server, using an SSL session cache can save some time, power, and bandwidth by skipping directly to an encrypted stream. This is a persistent cache which can span executions of the application.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [SSLSessionCache](#SSLSessionCache(android.content.Context))`(`context:` `[Context](../content/Context.html#)!`)` Create a session cache at the default location for this app. |\n| [SSLSessionCache](#SSLSessionCache(java.io.File))`(`dir:` `[File](../../java/io/File.html#)!`)` Create a session cache using the specified directory. |\n\nPublic constructors\n-------------------\n\n### SSLSessionCache\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nSSLSessionCache(context: Context!)\n```\n\nCreate a session cache at the default location for this app. Multiple instances share data internally.\n\n| Parameters ||\n|-----------|-----------------------------------------------------------|\n| `context` | [Context](../content/Context.html#)!: for the application |\n\n### SSLSessionCache\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nSSLSessionCache(dir: File!)\n```\n\nCreate a session cache using the specified directory. Individual session entries will be files within the directory. Multiple instances for the same directory share data internally.\n\n| Parameters ||\n|-------|-------------------------------------------------------------------------------------|\n| `dir` | [File](../../java/io/File.html#)!: to store session files in (created if necessary) |\n\n| Exceptions ||\n|-----------------------|------------------------------|\n| `java.io.IOException` | if the cache can't be opened |"]]