spierce7
08/21/2019, 4:29 PMkotlinx.serialization.json.JsonParsingException
, or using an equivalent extension function seems error prone and verbose. Surely there is a way to do this at the feature level?anli
08/22/2019, 10:37 AMresponse.readText()
. On the other hand it is official recommendation for 409 response to get payload. How to get the payload with ktor?4ntoine
08/23/2019, 10:58 AM1.3.50
and ktor and having ABI incompatibility (worked with 1.3.41
):
w: skipping /Users/asmirnov/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-core-macosx64/1.2.3/4987d836935e25e127e275b7147fa24ff9b24b1b/ktor-client-core.klib. The abi versions don’t match. Expected ‘[14]’, found ‘9’
w: The compiler versions don’t match either. Expected ‘[]’, found ‘1.3-rc1-11132’
e: Could not find “/Users/asmirnov/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-core-macosx64/1.2.3/4987d836935e25e127e275b7147fa24ff9b24b1b/ktor-client-core.klib” in [/Users/asmirnov/Documents/dev/src/cmp/project/desktop/performance_app, /Users/asmirnov/.konan/klib, /Users/asmirnov/.konan/kotlin-native-macos-1.3.50/klib/common, /Users/asmirnov/.konan/kotlin-native-macos-1.3.50/klib/platform/macos_x64].Anyone? As far as i can see Ktor 1.2.3 is not yet released for 1.3.50 and the most recent one is https://mvnrepository.com/artifact/io.ktor/ktor-client-core/1.2.3-1.3.50-eap-5
Leon K
08/23/2019, 6:36 PMgetSafe
that just wrap the HttpClient.get
method in a `Try`object, but i wonder if there is any way to get that out of the box / with a librarycoder82
08/26/2019, 9:48 AMShan
08/27/2019, 3:13 AMdarkmoon_uk
08/27/2019, 7:47 AM1.3.50
-based Ktor 'update' release? 🤞 Ksnackycracky
08/27/2019, 8:25 AMFail
08/27/2019, 8:52 AMEvgeniy Zaharov
08/27/2019, 4:11 PMktor
have any plans in future to implement a huge customization futures like spring
project have?
For example in spring exist inner DI with which you could in next configuration steps retrieve some bean from previous. Or in runtime replace any bean in context by creating it by yourself.
For now ktor doesn’t contain any DI system internal and such cases is difficult to implement without it. And for now I couldn’t imagine how to implement something like spring starters which are comes with new beans inserting to context + bean post processors which could customize beans depends on conditions/previous creatated beans/etc.
I don’t say that ktor
is going by wrong way or what it’s had some invalid architecture constructions. Me really likes how it constructs internal. And I just want to know, is at ever possible to do something like in spring for ktor?bram93
08/28/2019, 7:55 AMcoder82
08/28/2019, 8:28 AMsnackycracky
08/28/2019, 8:39 AMjava.io.IOException: Connection reset by peer
from Netty for all my requests that were answered with a 200. I understand that the client closed the connection, but why is then an exception thrown? Did somebody experience this before ?gotoOla
08/28/2019, 2:37 PMtjohnn
08/29/2019, 4:05 AMjava.util.NoSuchElementException: No session data found for id b8130c2077351466
, it works fine without containerizing it. Also, I am new to docker . Is there something I need to do that I am missing?eirikb
08/29/2019, 9:59 AMHttpClient
Tony Blundell
08/29/2019, 11:05 AM# python requests lib
url = '<https://example.com>'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
cert = (path_to_cert_file, path_to_key_file)
data = {
'username': username,
'password': password
}
r = <http://requests.post|requests.post>(url, headers=headers, cert=cert, data=data)
Jan Stoltman
08/29/2019, 1:33 PMOkHttp
on Android, but is there any way to achieve this with the Ios
engine on iOS as well?Ludd
08/29/2019, 1:44 PMJeremy
08/29/2019, 3:05 PMPere Casafont
08/30/2019, 9:10 AMbitkid
08/30/2019, 11:44 AMThomas
08/30/2019, 1:06 PMbitkid
08/31/2019, 12:29 PMRobin Larsen
08/31/2019, 9:09 PMhandle
method in a Route
.
My initial thought was that it is a place to put a piece of code that should execute every time the route is triggered - could be checking a cookie for relevant info and reacting accordingly. But it doesn't seem to work that way.
Can anyone shed some light on this one please 🙂Ingo Noka
09/02/2019, 6:25 AMTLSException
with error message
+
Unknown hash algorithm: 8
3. Analysis:
- The accuracy of all key and certificate files confirmed with successful openssl:
+
openssl s_client -connect IP:PORT -CAfile cacert.pem -cert client_crt.pem -key client_key.pem
- The output of openssl
gives a hint at what might be wrong:
+
[source,subs="quotes"]
.Requested Signature Algorithms:
ECDSA+SHA256:**0x04+0x08**:RSA+SHA256:ECDSA+SHA384:**0x05+0x08**:RSA+SHA384:**0x06+0x08**:RSA+SHA512:RSA+SHA1
+
.Shared Requested Signature Algorithms:
----
ECDSA+SHA256RSA+SHA256ECDSA+SHA384RSA+SHA384RSA+SHA512:RSA+SHA1
----
- I assume that the requested signature algorithms come from the server and include hash code 0x08 (as in 0x04+0x08
)
- I also assume that the 0x08
hash code comes from the new "Intrinsic" hash hash code introduced in RFC 8442 and registered by IANA [https://www.iana.org/assignments/tls-parameters/tls-parameters.txt]
- Looking into the source code of the TLS handshake routines of ktor-network-tls I find in io/ktor/network/tls/extensions/SignatureAlgorithm.kt
the following snippet:
+
kotlin
enum class HashAlgorithm(val code: Byte, val openSSLName: String, val macName: String) {
NONE(0, "", ""),
MD5(1, "MD5", "HmacMD5"),
SHA1(2, "SHA-1", "HmacSHA1"),
SHA224(3, "SHA-224", "HmacSHA224"),
SHA256(4, "SHA-256", "HmacSHA256"),
SHA384(5, "SHA-384", "HmacSHA384"),
SHA512(6, "SHA-512", "HmacSHA512");
companion object {
/**
* Find hash algorithm instance by it's numeric [code]
* @throws TLSExtension if no hash algorithm found by code
*/
fun byCode(code: Byte): HashAlgorithm = values().find { it.code == code }
?: throw TLSException("Unknown hash algorithm: $code")
}
}
- It seems to me that throwing an exception when encountering an unknown hash algorithm is not necessary. The algorithm would be ignored anyway when the list of mutually supported algorithms is build.
Questions:
. Is my analysis correct?
. Should I file an issue for ktor on Github and propose the following change options:
.. Add INTRINSIC(8, "INTRINIC", "Intrinsic")
to the HashAlgorithm
enum class
.. Change the return type of byCode()
to a nullable and ignore null when building the list of requested hash algorithms
. Is there a way to prevent a ruby.openssl based server (not ktor) from sending the new hash code value 8? (Please ignore this question if it does not belong to ktor|kotlinlang)gumil
09/02/2019, 7:50 AMcoder82
09/02/2019, 8:43 AMAalok
09/02/2019, 10:51 AMmartin.petrulak
09/02/2019, 1:21 PMHashMap<Long,MyObject>
and don't access the DB all the time i will get faster response times, but i did not . It takes more time to execute the request if i add this "cache (hash map)" there.
Is it fine to use mysql only, since it contains some sort of caching?