Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: MbedTLS.SSLContext does not support byte I/O #197

Open
biluohc opened this issue Mar 10, 2019 · 2 comments
Open

ERROR: MbedTLS.SSLContext does not support byte I/O #197

biluohc opened this issue Mar 10, 2019 · 2 comments

Comments

@biluohc
Copy link

biluohc commented Mar 10, 2019

Can you support this? The ordinary socket could be read by readuntil and 'readline' funtions.

julia> readline(c)
ERROR: MbedTLS.SSLContext does not support byte I/O
Stacktrace:
 [1] error(::Type, ::String) at ./error.jl:42
 [2] read(::MbedTLS.SSLContext, ::Type{UInt8}) at ./io.jl:182
 [3] #readuntil#290 at ./io.jl:653 [inlined]
 [4] #readuntil at ./none:0 [inlined]
 [5] #readline#284(::Bool, ::Function, ::MbedTLS.SSLContext) at ./io.jl:370
 [6] readline(::MbedTLS.SSLContext) at ./io.jl:370
 [7] top-level scope at none:0
@samoconnor
Copy link
Contributor

My feeling is that supporting one-byte-at-a-time IO, and thereby allowing use of readuntil, readline, etc would encourage inefficient code because one-byte-at-a-time loop inside readuntil would call all the way down into the TLS library.
Better to use a buffering wrapper like https://github.com/BioJulia/BufferedStreams.jl

@biluohc
Copy link
Author

biluohc commented Mar 19, 2019

@samoconnor ,Thanks you, I used IOBuffer finally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants