<bramford>
hannes: Is there a documented/known way to use cohttp-mirage with ocaml-tls to make https client requests in a mirage unikernel? 'example' (in ocaml-tls) is the only non-unix TLS web client example I've found so far but doesn't use cohttp.
<hannes>
bramford: not sure whether any cohttp-mirage documentation is around, sorry about that. on the positive side, I did successfully do https client connections with cohttp and tls :)
<Drup>
isn't there is a unikernel in mirage skeleton who serves a static website on https ?
<bramford>
hannes: Ok cool, I'll check it out. In the meantime, I think I found a way - Use Cohttp_mirage.Client.ctx (with a TLS conduit and a DNS resolver)
<hannes>
Drup: bramford asked about a https _client_
mort___ has quit [Quit: Leaving.]
<hannes>
bramford: important to remember that (iirc) conduit/cohttp doesn't provide any interface to do certificate verification in such a setting, and just accept any certificate
<bramford>
hannes: Yeah that's an issue. So I can't construct a new Tls.Config.client and provide it somehow?
<hannes>
bramford: you've to ask conduit / cohttp people about that, I don't understand their interfaces too well
<bramford>
hannes: Ok, it seems like a rather common requirement.
<hannes>
bramford: I do agree, and at least on the TLS interface it is easily doable!
Haudegen has quit [Remote host closed the connection]
<bramford>
Ah yep, seems like a rather well-highlighted issue
<bramford>
hannes: Thanks for the gist example. A question - How does the conduit become TLS-capable? Is it due to `let ctx = Cohttp_mirage.Client.ctx resolver ctx in`?
<Ulrar>
Okay so now my unikernel works fine with unix backend. I'm trying to compile it with virtio, but I get "ocamlfind: Package `mirage-bootvar-solo5' not found" and a after that "ocamlfind: Package `nocrypto.mirage' not found"
<Ulrar>
make depend doesn't show any errors, but make fails with that
mort___ has joined #mirage
<hannes>
bramford: again I don't know much about the conduit design choices here, but "Conduit_mirage.with_tls ctx >>= fun ctx ->" does the trick (this requires conduit compiled with tls)
<hannes>
Ulrar: you have mirage-solo5, mirage-entropy, and zarith-freestanding installed? if not, install them. if yes, reinstall nocrypto.
<Ulrar>
Yeah looks like I have mirage-no-solo5 conflicting
<Ulrar>
shouldn't make depend tell me this ?
<Ulrar>
opam install mirage-bootvar-solo5 seems to have a plan to fix it, so let's try that
<bramford>
mort___: Interesting, but definitely complex. More so than the mirage https client example found in ocaml-tls.git
<hannes>
mort___: that again is a TLS server which forwards as a TCP client... ;)
Haudegen has joined #mirage
<mort___>
true, i did say might :)
mort___ has quit [Quit: Leaving.]
argent_smith has joined #mirage
argent_smith1 has joined #mirage
argent_smith has quit [Ping timeout: 260 seconds]
<Ulrar>
Mh, it's not booting. qemu stays stuck on "booting from ROM..." and nothing happens after that
<Ulrar>
The exact same config works fine with rumprun, so it must be something to do with solo5
<Ulrar>
Okay got it, solo5 just ignores vga, you have to use serial. Fair enough
<hannes>
Ulrar: sounds like that isn't very visibly documented anywhere? if so, and you feel like it, open a issue or PR at the solo5 (or mirage) repository!?
<Ulrar>
Well it is written on the solo5 github, but as far as I can tell it isn't on mirageos
<Ulrar>
But reading the solo5 github I can see that it supports one serial on com1, one virtio block and one virtio net
<Ulrar>
hence it doesn't support any vga
<Ulrar>
Similarly, --ipv4 is documented everywhere, but I couldn't find anything about how to provide the gateway. Looks like it's --ipv4-gateway
<Ulrar>
Guess most people aren't using regular kvm
<Ulrar>
Now it seems to be assigning it's public v4 properly, it pings, but port 80 stays closed for some reason
<Ulrar>
Maybe because it's 8080 in my code .. nevermind
<Ulrar>
Sorry for the noise
mort___ has joined #mirage
<Ulrar>
Yeah it works fine. Problems solved, thanks :)
mort___ has left #mirage [#mirage]
<hannes>
\o/
<hannes>
I use --ipv4 and --ipv4-gateway quite a lot
andreas23 has quit [Quit: Leaving.]
poka has quit [Quit: leaving]
poka has joined #mirage
Haudegen has quit [Remote host closed the connection]
Haudegen has joined #mirage
mort___ has joined #mirage
mort___ has quit [Quit: Leaving.]
Haudegen has quit [Remote host closed the connection]
mort___ has joined #mirage
andreas23 has joined #mirage
Haudegen has joined #mirage
<Ulrar>
Yeah, I wish there was a way to configure ipv4 programatically though, at runtime
<Ulrar>
would allow for some interesting stuff
<Ulrar>
although if solo5 only supports one net device, maybe not
mort___ has quit [Quit: Leaving.]
andreas23 has quit [Quit: Leaving.]
mort___ has joined #mirage
Haudegen has quit [Remote host closed the connection]
mort___ has left #mirage [#mirage]
<bramford>
Ulrar: When you run `mirage configure -t virtio` it will spit out a file `_libvirt.xml`. It includes examples of the devices solo5 supports - A single instance of each - serial console, clock, block device, network interface. The names of these devices apperars to be irrelevant.